Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ExtJS存储在视图中创建存储时添加extraParams_Extjs_Extjs4_Extjs4.1_Extjs4.2_Extjs Mvc - Fatal编程技术网

ExtJS存储在视图中创建存储时添加extraParams

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

我有我的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: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
        }
    }
})