0
我想從另一個面板用戶js文件訪問由ext designer創建的JsonStore。 從設計師生成的文件存儲文件看起來像這樣從另一個文件訪問Ext Designer JsonStore
myJsonStore = Ext.extend(Ext.data.JsonStore, {
constructor: function(cfg) {
cfg = cfg || {};
CoaJsonStore.superclass.constructor.call(this, Ext.apply({
storeId: 'myJsonStore',
url: '/server.json',
restful: true,
autoLoad: true,
autoSave: false,
fields: [
{
name: 'id'
},
{
name: 'code'
},
{
name: 'name'
}
]
}, cfg));
}
});
new myJsonStore();
我在做什麼,現在使用隱藏的組合並指定商店組合,這可以讓我通過autoRef訪問(使用。二合一.getStore(),它給了我一個對象類型的Store)。理想情況下,我希望能夠做到沒有隱藏的組合。
我試過用storeId指向它,但它不起作用,如果我將storeId記錄到控制檯,這就是我所得到的。
function (cfg) {
cfg = cfg || {};
CoaJsonStore.superclass.constructor.call(this, Ext.apply({
storeId: 'myJsonStore',
url: '/coas.json',
restful: true,
........
所以我只是想知道這是否甚至可能。如果有的話,如何做到這一點將不勝感激。謝謝