PDA

View Full Version : How to get value of a combobox in a proxy store?



eaglefox12
20 Nov 2012, 1:00 PM
I have a store that sends a parameter to my controller. When I define my store


proxy: {
type: 'ajax',
scope: this,
url: 'My/GetData',
extraParams: {
parametervalue: Ext.getCmp('Combo').getValue() //something similar
}
}

I am not updating the store on combo selection. Or else I could have just added a listener on combo and updated the store.
I want to get the value of the combobox when the grid is loaded. It also works with paging, so when the user hits next page the store loads the second page "with" the selected value in the combobox, which it passes to my controller.

mitchellsimoens
22 Nov 2012, 6:22 AM
So the store is already created so the getValue is going to happen too soon correct? You could have a beforeload event listener to add in a param.

Or when the change event fires on the combo, add that value to the extraParams of the store.

eaglefox12
22 Nov 2012, 12:41 PM
Hi Mitchell... thanks for your response... i think i know what you are talking about but not sure how to go about doing that on extjs... m totally new to this.. could you please show me an example of what you just explained... i'd really appreciate... thanks
So the store is already created so the getValue is going to happen too soon correct? You could have a beforeload event listener to add in a param.

Or when the change event fires on the combo, add that value to the extraParams of the store.