View Full Version : Restting combobox store contents

8 Nov 2010, 12:06 PM
I have the following code inside a combo select:

var cboModel = Ext.getCmp('id_combo_model');
cboModel.store.setBaseParam('id_manufacturer', id_manufacturer);

Basically it's reassigning the manufacturer of the proceeding combobo to re-populate the list based on manufacturer selected. I swear this worked before now I have tried this in several different areas and it only seems to work on the first selection of the manufacturer. If I change manufacturer again, nothing seems to happen.

What properties have I possibly changed to cause this undesired effect?


8 Nov 2010, 9:46 PM
I think I may have the same problem. I am relatively new to extjs and I have a toolbar with next/prev buttons. Using setBaseParams to set a grid refresh. If the user clicks the next button then the BaseParam 'action' is set to next, previous button then previous. What appears to be happing is the first value that is set via setBaseParam, sticks.

Basically if I click previous button first then the BaseParam 'action' never gets set to next. If I click the next button first then the param 'action' never changes to previous.

8 Nov 2010, 11:38 PM
Is this a mode:'remote' combobox?

In that case use:

var combo = Ext.getCmp('id_combo_model');
delete combo.lastQuery;
combo.store.setBaseParam('id_manufacturer', id_manufacturer);
(no need to reload - combobox will do that for you when first used)