PDA

View Full Version : extJS and HTML select



funandlearning
15 Nov 2010, 12:40 PM
Hi All -
I am new to extJS, and trying to implement the following functionality.
I have two select drop downs, transformed using ext JS. How can I make sure that if a value in one combo box is selected, the other value should be set back to some default value?


Below is the code


Ext.onReady(function(){

var converted = new Ext.form.ComboBox({

typeAhead: true,
triggerAction: 'all',
transform:'id_Select1',
width:600,
forceSelection:true,
emptyText:'Select'

});

var converted2 = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'id_select2',
width:600,
forceSelection:true,
emptyText:'Select'
});
});I am using Coldfusion to query the database and populate the dropdowns:


<cfquery name="getData1" datasource="abc">
SELECT * FROM table1
</cfquery>

<cfquery name="getData2" datasource="abc">
SELECT * FROM table2
</cfquery>

<select name="select1" id="id_select1">
<cfoutput query="getData1">
<option value="#getData1.Id#">#getData1.name#</option>
</cfoutput>
</select>

<select name="select2" id="id_select1">
<cfoutput query="getData2">
<option value="#getData2.Id#">#getData2.name#</option>
</cfoutput>
</select>

funandlearning
16 Nov 2010, 11:55 AM
Can anyone atleast let me know what happens when a normal html select is converted to a extJS combobox. How to set values and all? Just in case, I am using extJS 1.1

nicorama
19 Nov 2010, 7:55 AM
The Combo is linked to a store. So you have to configure a store, using I guess Ext.Direct with ColdFusion.