PDA

View Full Version : combo box



alien3d
9 Oct 2009, 5:53 PM
I still confuse with ext combo box
E.g in html


<select name ="y" >

<option value=1>First </option>
<option value=2>Second</option>
<option value=3 selected>Third</option>
<option value=4>Fourth</option
</selected>

In Extjs we haved been teach using data store.How to loop the data store and appear the Third as selected?It is nessary data store required ?I will not like to build json for each combobox drop down i make.:((
I thinking Extjs should be simplifier more :D
E.g


var x = new Ext.combobox ({
option_value_array: items[{ 1,2,3,4,5 }],
option_output_array: items [{ 'First','Second','Third','Fourth'}]
option_selected_index : 3
});

Condor
10 Oct 2009, 3:58 AM
It's not that hard:

var x = new Ext.form.ComboBox({
hiddenName: 'y',
store: [
[1, 'First'],
[2, 'Second'],
[3, 'Third'],
[4, 'Forth']
],
value: 3,
triggerAction: 'all',
editable: false
});

alien3d
10 Oct 2009, 4:30 AM
You should put this example in your example folder. :D:D:D

trasherdk
10 Oct 2009, 6:01 AM
Alien3D

You asked for examples, try:

http://www.extjs.com/deploy/dev/examples/

and specific for combo's:

http://www.extjs.com/deploy/dev/examples/form/combos.html

Enjoy

Mogens