Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 如何在存储文件夹中使用存储定义_Sencha Touch - Fatal编程技术网

Sencha touch 如何在存储文件夹中使用存储定义

Sencha touch 如何在存储文件夹中使用存储定义,sencha-touch,Sencha Touch,我是新来sencha touch的。我想知道如何正确使用SenchaTouch中的文件结构。例如,在应用程序文件夹下有控制器、模型、配置文件、存储、视图文件夹。如果我定义了一个存储,例如在存储文件夹下,我会创建一个名为search.js的文件 Ext.define('Volunteer.store.search'{ extend: 'Ext.data.Store', requires: ['Volunteer.model.person'], config:{

我是新来sencha touch的。我想知道如何正确使用SenchaTouch中的文件结构。例如,在应用程序文件夹下有控制器、模型、配置文件、存储、视图文件夹。如果我定义了一个存储,例如在存储文件夹下,我会创建一个名为search.js的文件

Ext.define('Volunteer.store.search'{
    extend: 'Ext.data.Store',
    requires: ['Volunteer.model.person'],
    config:{
        model: 'Volunteer.model.person'
    }
});

如何在其他文件中使用此存储?

在app.js文件中添加您的存储
存储:['search']
和您调用的不同文件
Ext.getStore('search')。如果找不到,您需要将search.js添加到index.html中

我知道了怎么做。您可以使用Ext.Loader.config({path:'model':'app/model/);然后使用Ext.require('model.login',function())