Question

i am not able to figure out the problem in the following sencha-touch code i have written. it shows no errors but still when i run it, it doesn't work. are there any more files or classes that the application requires? i am running it on chrome using a linux machine.

    var App = new Ext.application({
    requires: [
             'Ext.tab.Panel' ,'Ext.List', 'Ext.data.Store', 'Ext.data.Model'
         ],
        name : 'notesapp',
        useLoadMask : true,
        launch : function () {




    Ext.regModel('note',{
    idProperty:'id',
    fields:[{name :'id', type:'int'},
        {name : 'date', type: 'date', dateFormat:'c'},
        {name : 'title', type: 'string'},
        {name : 'narrative' , type:'string'}],
    validations:[{type: 'presence', field: 'id'},
            {type: 'presence', field: 'title'}  ]
        });

    Ext.regStore('notestore', {
    model:'note',
    sorters:[{
    property:'date',
    direction:'DESC'
    }],

    proxy:[{
    type:'localstorage',
    id:'notes-app-local-store'
    }],

    data: [
        { id: 1, date: new Date(), title: 'Test Note', narrative: 'This is simply a test note' }
        ]



    }
    );

var notelist= new Ext.List({
    id:'notelist',
    store:'notestore',
    itemTpl:
    '<div class= "list-item-title">{title}</div>'
    + '<div class="list-item-narrative">{narrative}</div>'

    });



var noteslisttoolbar = new Ext.Toolbar({

    id:'noteslisttoolbar',
    title:'MyNotes'
    });


var noteslistcontainer=  new Ext.Panel({

    id:'noteslistcontainer',
    layout:'fit',

    dockedItems:[noteslisttoolbar],
    items:[notelist]


        });
    this.viewport = new Ext.Panel({
    fullscreen: true,
    layout:'card',
    cardAnimation:'slide',
    items:[noteslistcontainer]

    });

        }
})
Was it helpful?

Solution

your getting an error at

          proxy:[{
            type:'localstorage',
            id:'notes-app-local-store'
        }],

please check there.. with out that code sencha app running fine

see http://www.senchafiddle.com/#j2f0i

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top