PDA

View Full Version : How to get value in combobox?



big
22 Feb 2010, 1:14 AM
How to get value in combobox? i want to get value it for compare with PHP because i want to do cascading combobox.

fay
22 Feb 2010, 3:27 AM
Have you looked at the documentation for Ext.form.ComboBox (http://www.extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox)? See getValue()

danellison
22 Feb 2010, 10:13 AM
var combo = new Ext.form.ComboBox({
id: 'mycombo',
store: ...
});

combo.on('select', myHandler);

var combo2 = new Ext.form.ComboBox({
....
});

function myHandler() {
var value = this.getValue(); // or Ext.getCmp('mycombo').getValue();
switch(value) {
case "A":
combo2.filter('filterfield', value); // whatever you need for the combo2 selections
break;

....

}
}


Of course, you could use any number of ways to set the values in combo2 - combo2.store.setBaseParams({....}); combo2.store.load(); is another method.

Good luck,
Dan

big
22 Feb 2010, 8:08 PM
:Dthank you!!