1
我的代碼有一個錯誤,但我無法弄清楚什麼是錯的。 我嘗試在點擊NestedList的葉子項時在Store中設置新的url。 這裏是我的商店:如何在商店代理中設置網址?
Ext.define('Application.store.DetailStore', {
extend: 'Ext.data.Store',
config: {
model: 'Application.model.DetailModel',
autoLoad :true,
sorters: 'title',
grouper : function(record) {
return record.get('title')[0];
},
proxy: {
type: 'ajax',
url : '/data/data1.php',
reader: {
type: 'json',
rootProperty:'recipes'}
}
}
});
這是NestedList我leafitemtap的聽衆:
onLeafItemTap: function(nestedList, list, index, node, record, e) {
filter = record.get('text');
var detailCard = nestedList.getDetailCard();
Ext.getStore('Application.store.DetailStore').getProxy().setUrl('/data/data2.php');
Ext.getStore('Application.store.DetailStore').load()
}
這個我上無法敲擊葉項目和細節卡不顯示了。 有誰知道什麼可能是錯的?
回讀了,如果你想要做的是設置並加載店只寫問題的STOREID:Ext.getStore(」 Application.store.DetailStore')。setProxy({type:'ajax', url:'/data/data2.php'})。load() 而不是使用getProxy和setUrl –
感謝您的回覆!但它沒有幫助,我仍然不能點擊葉子項目。我測試了刪除代碼的一些部分,當我在Ext.getStore('Application.store.DetailStore')之後寫東西時,它停止工作。 –
您可以發佈從存儲中獲取的NestedList視圖,模型和JSON嗎? –