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>
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>