PDA

View Full Version : dynamic dependant combobox store



r6174
9 Mar 2014, 9:51 PM
Hi,
How can i load a store for a combobox dynamically based on a input for a text field
like if i give input to a textfield as 5 ,the combo must display 0-5 numbers if i give 4 to text field i must display only 0-4.i tried this but no use


var combo1 = Ext.getCmp('level');
var roles_levels_ds = combo1.store;
roles_levels_ds.on('load', function() {
for(i=0;i<=maxRoleLevels;i++){
roles_levels_ds.setValue(i);
roles_levels_ds.commit();
}


})

slemmon
13 Mar 2014, 10:56 AM
You can set an expand listener on the combo to evaluate the value of the textfield and use the value to filter the combo's store. Something like:

48r