List 找不到指定的存储区sencha touch

List 找不到指定的存储区sencha touch,list,extjs,model-view-controller,store,List,Extjs,Model View Controller,Store,我使用MVC架构将数据加载到列表中,并在屏幕上显示它。 在运行应用程序时,我发现以下错误 [警告][test.view.list#applyStore]找不到指定的存储 我尝试按照给出的说明进行操作,但它给了我错误: 在null/view/list.js null/store/list1store.js null/model/list1modeljs中找不到文件 应用程序的根目录是“test” 列出模型文件: Ext.define('test.model.list1model', { exten

我使用MVC架构将数据加载到列表中,并在屏幕上显示它。 在运行应用程序时,我发现以下错误

[警告][test.view.list#applyStore]找不到指定的存储

我尝试按照给出的说明进行操作,但它给了我错误:

在null/view/list.js null/store/list1store.js null/model/list1modeljs中找不到文件

应用程序的根目录是“test”

列出模型文件:

Ext.define('test.model.list1model', {
extend: 'Ext.data.Model',
config: {
    fields: [
        {name: 'firstName', type: 'string'},
        {name: 'lastName',  type: 'string'},
        {name: 'age',       type: 'int'},
        {name: 'eyeColor',  type: 'string'}
        ]
    }
});
列表存储文件:

Ext.define("test.store.list1store", {
extend:'Ext.data.Store',
requires:['test.model.list1model'],
config:{
  model: "test.store.list1model",
data : [
    {firstName: "Ed",    lastName: "Spencer"},
    {firstName: "Tommy", lastName: "Maintz"},
    {firstName: "Aaron", lastName: "Conran"},
    {firstName: "Jamie", lastName: "Avins"}
]
}
});
列表视图文件:

Ext.define("test.view.list", {
extend:'Ext.List',
requires:['test.store.list1store'],
config:{fullscreen: true,
store: 'test.store.list1store',
itemTpl: "{lastName}, {firstName}"
}
});
app.js:

Ext.application({
requires: [
'Ext.dataview.List',
'Ext.Panel',
 'Ext.Spacer',
  'test.view.list',
  'Ext.List',
  'test.model.list1model',
  'test.store.list1store'
],
launch : function(){
    list1 =Ext.create('test.view.list');
    Ext.create('Ext.Container',{
      id:'contain',

      fullscreen:true,
      items:[
    list1,
      ]
    })
  }
});

您只定义了一个存储,但没有实例化它。请尝试以下操作:

Ext.define("test.view.list", {
    extend:'Ext.List',
    requires:['test.store.list1store'],
    fullscreen: true,

    constructor : function() {
        this.callParent();
        this.setStore(Ext.create("test.store.list1store"));
    },

    config: {
        fullscreen: true,
        itemTpl: "{lastName}, {firstName}"
    }

});

PS:将存储区中的模型更正为:
model:“test.model.list1model”

谢谢您的帮助,到目前为止,所有错误都已删除,但列表中没有填充数据。:)好了,现在数据已在存储区中定义,我使用
setStore()
方法。但是存储的任务是多方面的:还定义代理、模型、数据、过滤器……让我们来清理注释。PS:我认为在Sencha Touch中,它与ExtJS的工作原理类似,但商店是不同的。如果你想快速播放,检查哪些有效,哪些无效,请检查