0

我无法在我编写的以下 sencha-touch 代码中找出问题所在。它没有显示任何错误,但是当我运行它时,它仍然不起作用。应用程序还需要更多文件或类吗?我正在使用 linux 机器在 chrome 上运行它。

    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]

    });

        }
})
4

1 回答 1

-2

你得到一个错误

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

请检查那里..没有那个代码sencha应用程序运行良好

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

于 2013-01-03T05:11:45.947 回答