extjs - Ext JS Dependent combo box -


i new extjs, , trying implement following functionality:

i have 2 select drop down menus, transformed using extjs. how can make sure if value in 1 combo box selected, other value should set default value?

thanks.

edited: code till now:

ext.onready(function(){   var converted = new ext.form.combobox({       typeahead: true,      triggeraction: 'all',      transform:'id_select1',      width:600,      forceselection:true,      emptytext:'select'   });   var convertedcdr = new ext.form.combobox({      typeahead: true,      triggeraction: 'all',      transform:'id_select2',      width:600,      forceselection:true,      emptytext:'select'  });  }); 

i using coldfusion query database , populate drop down menus:

<cfquery name="getdata1" datasource="abc">    select * table1 </cfquery>  <cfquery name="getdata2" datasource="abc">    select * table2 </cfquery>  <select name="select1" id="select1">   <cfoutput query="getdata1">        <option value="#getdata1.id#">#getdata1.name#</option>   </cfoutput> </select>   <select name="select2" id="select1">   <cfoutput query="getdata2">        <option value="#getdata2.id#">#getdata2.name#</option>   </cfoutput> </select> 

edited - haven't used cfm... you'll need figure out how load cf using data stores use technique.

you need add listener select event on combo:

xtype: 'combo', id   : 'firstcomboid', listeners: {   select: function(combo,  record,  index ) {     var selval = ext.getcmp('firstcomboid').getvalue();     var secondcombo = ext.getcmp('secondcomboid');     secondcombo.store.reload({params: {yourparametername: selval}}); } 

basically doing following here:

  1. get value selected in first combo
  2. get reference second combo's data store
  3. reload store of second combo box using selected value first combo

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -