PDA

View Full Version : select extjs Combo box by index



rakesh_sencha
22 May 2011, 9:46 AM
hi


i want to select the combobox element by index.
using setValue() take me to multiple issues and was going roundabout methods.

so please let me know if their is any way to select the ext js combobox by index.


thank you in advance..

fay
23 May 2011, 4:58 AM
Try:



var index = 1; // or whatever
cb.setValue(cb.getStore().getAt(index).get(cb.valueField)); // cb = your combobox

Angilo
23 May 2011, 5:04 AM
Using setValue(); is really usefull and not that hard.

Make sure in your combobox you set a default value, for instance value: ''

After your combobox is rendered and before you perform your action, you need to implement this:
Combo.store.clearFilter();
Combo.setValue('someindexvalue');

rakesh_sencha
23 May 2011, 5:19 AM
hi thank you for all ur replies with concern

but using setvalue, is assigning the value to combobox directly rather getting appropriate index.