var gridStore = Ext.create('Ext.data.Store', {
model: 'Writer.Person',
autoLoad: true,
autoSync: false,
proxy: {
type: 'ajax',
api: {
read: '?operant=2',
create: '?operant=3',
update: '?operant=4',
destroy: '?operant=5'
},
reader: {
type: 'json',
successProperty: 'success',
root: 'data',
messageProperty: 'message',
extraParams: {
user_id: "some text",
another_param: "more text"
}
}
}
});
我试过用baseParams,params,我用fiddler来看看,extjs没有发送这个,怎么办?感谢
答案 0 :(得分:1)
选中此项,会显示您的问题的一些解决方法:http://www.learnsomethings.com/2011/05/17/where-did-setextraparam-aka-setbaseparam-go-in-extjs-4-%E2%80%93-one-workaround/
答案 1 :(得分:1)
我相信您正在寻找extraParams
,这是proxy
下的配置。例如:
proxy: {
url: "some_page.jsp",
extraParams: {
user_id: "some text",
another_param: "more text",
// add as many as you need
}
}
这些额外参数将在您的请求中发送。 Ajax代理类还设置了默认参数:pageParam, sortParam, groupParam, filterParam, limitParam
。将这些设置为undefined
以将其从请求中删除。