2012-10-15 76 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()) –