0

I have my ExtJS 4.2.1 Application and Inside my view:

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}
    }),

I can do that inside my controller:

onEmployeeBeforeQuery: function(queryPlan, eOpts) {
        var me = this,
            employerId = me.getEditRequest().down('#cboEmployer').getValue(),
            store = me.getEditRequest().down('#cboEmployee').getStore()

        store.getProxy().extraParams = {
            employerId: employerId
        };
    },

But how can I do this in my view when creating the store?

Thanks.

VAAA
  • 14,531
  • 28
  • 130
  • 253

1 Answers1

0

You can configure a proxy when creating the store:

store: Ext.create('App.store.employee.EmployeeCombo', {
    proxy:{
        type:'ajax',
        url:'.....',
        extraParams:{
            // your extra params here
        }
    }
})
Saki
  • 5,827
  • 2
  • 15
  • 15