2012-10-15 65 views
0

我不熟悉sencha-touch。我想知道如何正确使用sencha-touch中的文件结构。例如,在应用程序文件夹下有您的控制器,型号,配置文件,商店,查看文件夹。如果我定义了一个商店,例如下的存储文件夹创建一个名为search.js如何在商店文件夹中使用商店定义

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

文件如何在不同的文件中使用这个店?

回答

1

Add your store in app.js文件stores: ['search']和另一个文件您调用Ext.getStore('search');。如果找不到,则需要将search.js添加到index.html中。

+0

我想出了如何做到这一点。你可以使用Ext.Loader.config({paths:'model':'app/model /);.然后使用Ext.require('model.login',function()) –