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吗? –