首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sencha-touch应用程序不工作

sencha-touch应用程序不工作
EN

Stack Overflow用户
提问于 2013-01-03 11:11:03
回答 1查看 465关注 0票数 0

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

代码语言:javascript
复制
    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]

    });

        }
})
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-03 13:11:46

您在以下位置收到错误

代码语言:javascript
复制
          proxy:[{
            type:'localstorage',
            id:'notes-app-local-store'
        }],

请在那里检查一下。没有代码,sencha应用运行得很好

请参阅http://www.senchafiddle.com/#j2f0i

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14132529

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档