ExtJS存储在视图中创建存储时添加extraParams
我有我的ExtJS 4.2.1应用程序,在我的视图中:ExtJS存储在视图中创建存储时添加extraParams,extjs,extjs4,extjs4.1,extjs4.2,extjs-mvc,Extjs,Extjs4,Extjs4.1,Extjs4.2,Extjs Mvc,我有我的ExtJS 4.2.1应用程序,在我的视图中: xtype: 'combobox', itemId: 'cboEmployeeNumber', width: 180, store: Ext.create('App.store.employee.EmployeeCombo', { // here I want to set extraParams maybe like // proxy.extraParams:{ employerId
xtype: 'combobox',
itemId: 'cboEmployeeNumber',
width: 180,
store: Ext.create('App.store.employee.EmployeeCombo', {
// here I want to set extraParams maybe like
// proxy.extraParams:{ employerId:0}
}),
我可以在控制器内执行此操作:
onEmployeeBeforeQuery: function(queryPlan, eOpts) {
var me = this,
employerId = me.getEditRequest().down('#cboEmployer').getValue(),
store = me.getEditRequest().down('#cboEmployee').getStore()
store.getProxy().extraParams = {
employerId: employerId
};
},
但在我看来,在创建商店时如何做到这一点
谢谢。您可以在创建存储时配置代理:
store: Ext.create('App.store.employee.EmployeeCombo', {
proxy:{
type:'ajax',
url:'.....',
extraParams:{
// your extra params here
}
}
})