在 sencha-touch 上,这是我的商店声明
Ext.regStore('newsStore', {
model: 'News',
autoLoad: true,
proxy: {
type: 'ajax',
url: '../news/list.form?format=json',
reader: {
type: 'json',
root: ''
}
},
});
如何修改参数?我试过
params:{ format: 'json'}
但它不起作用!
最佳答案
店铺声明
new Ext.data.Store({
model:'prj.models.ContactInfo',
storeId:'contactInfoId',
proxy:{
type:'ajax',
url:'/GetContactInfoByID',
reader:{
type:'json'
},
extraParams:{
format:'json'
},
listeners:{
exception:function(proxy, response, orientation){
console.error('Failure Notification', response.responseText);
Ext.Msg.alert('Loading failed', response.statusText);
}
}
}
});
将参数添加到代理和读取 ajax 存储
prj.stores.contactInfoId.getProxy().extraParams.partyID = options.partyID;
prj.stores.contactInfoId.getProxy().extraParams.eventName = options.eventName;
prj.stores.contactInfoId.read();
希望这可以帮助。
关于sencha-touch - 如何在商店中更改/添加参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6120713/