PDA

View Full Version : How to set value in combo box,if checkbox is checked?



sadaq
23 Feb 2012, 8:30 AM
Hi All,
i'm new to Extjs...this is my first post in this forum..i hope someone help me...:)
my query is..
i have a checkbox and combobox in a panel,if i select checkbox i wanted to set some value in combobox,
values are in store to set the value in combobox.

Thanks in Adv.

mitchellsimoens
23 Feb 2012, 8:36 AM
You can listen to the check event on the checkbox. Then you would have to resolve the combobox from that listener to take the appropriate action on the combobox.

sadaq
23 Feb 2012, 8:59 AM
Hi,
thanks for ur reply,
any sample or example will be helpful.

thanks in adv.

darthwes
23 Feb 2012, 11:04 AM
{
xtype: 'form',
items: [{
xtype: 'checkbox',
ref: 'myCheckbox'
...,
listeners: {
check: function (checkbox, isChecked) {
this.ownerCt.myCombo.setValue('someValue');
}
}
}, {
xtype: 'combo',
ref: 'myCombo',
...
}]
}


Something like that. You can avoid the inline listeners option if you so desire. Grab the form after it's instantiated and



form.myCheckbox.on('check', function (checkbox, isChecked) {
this.myCombo.setValue('someValue');
}, form);

sadaq
24 Feb 2012, 1:04 AM
Hi Wes,
thanks u so much.. for ur help...
it's working...:)