PDA

View Full Version : ExtJs Transform Combobox By Class name



saucompeng
2 Feb 2011, 5:13 AM
<select name="state" id="state" class="combobox">
<option value="AL">Alabama</option>
.
.
.
</select>

<select name="state2" id="state2" class="combobox">
<option value="AL">Alabama</option>
.
.
.
</select>


How do I transform all members of .combobox class ? > applyTo allow only ID , I want to use Class name ?

Please help me_?

Condor
2 Feb 2011, 5:23 AM
Ext.select('.combobox', true).each(function(el){
new Ext.form.ComboBox({
transform: el,
...
});
});

saucompeng
2 Feb 2011, 5:28 AM
Thanks a lot , That's good ;)

saucompeng
8 Feb 2011, 4:35 AM
Then how to select ( Ext.getCmp(?) ) combobox by Id ?

Condor
12 Feb 2011, 2:50 AM
If you know the id then you can use Ext.getCmp. Do you know the id?

saucompeng
12 Feb 2011, 2:51 AM
Yes, I know but it doesnt get it with getCmp!

Condor
12 Feb 2011, 2:53 AM
Is it really the id of the ComboBox or is it the id of the element?

In that case you would have to assign the id to the component:

Ext.select('.combobox', true).each(function(el){
new Ext.form.ComboBox({
id: el.id,
transform: el,
...
});
})

saucompeng
12 Feb 2011, 2:55 AM
Ok , I will try it , then I will write result here.. Thanks