2015-05-02 36 views
0

我正嘗試將Chained DataStore示例移植到現有的Ext應用程序中。從這KitchenSink example我放置在下面的源代碼到Ext.application並得到'KitchenSink沒有定義。 KitchenSink的定義在哪裏?我以爲KitchenSink是之前的軟件包名稱的一部分,但是在這個例子中是否被引用爲單例?ExtJS 5鏈式數據存儲示例:KitchenSink未定義

Ext.application({ name: 'testApp', stores: { everyone: { model: 'Person', data: KitchenSink.model.Person.generateData(15, 10) }, adults: { source: '{everyone}', filters: [{ property: 'age', value: 18, operator: '>=' }], sorters: [{ property: 'age', direction: 'ASC' }] } } });

+0

在viewmodel中聲明的商店與應用程序中的商店不同,請參閱:http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.app。控制器-CFG-店 –

回答

0

你還引用的例子包括一個名爲KitchenSink.model.Person模型,你還沒有包括在內。您發佈到KitchenSink.model.Person.generateData(15, 10)的代碼中的參考用隨機生成的Person模型填充商店。

如果您希望在沒有編輯的情況下運行,您需要複製此示例中的View,ViewModel,ViewController和Model。