I'm very new to ExtJs and I wanted to display an alert box on clicking one of the radio buttons, but it does not seem to work. Could anyone guide me through this step? The listener does not seem to work.
{
xtype: 'radiogroup',
fieldLabel: 'Does Nodes hav开发者_Go百科e DHCP IP Scheme?',
id:'dhcpRadio',
columns: [50, 50],
// Arrange radio buttons into two columns, distributed vertically
columns: 2,
vertical: true,
items: [{
boxLabel: 'Yes',
name: 'rb',
inputValue: 'yes',
listeners: {
check: function(rb,value){
if(value=='yes')
alert('yes');
else alert('no');
}
}
},{
boxLabel: 'No',
name: 'rb',
inputValue: 'no',
checked: true
}]
}
Like Gregory just said, Radio does not have a click
event.
You could try the change
event instead:
listeners: {
change : function(rb, newValue, oldValue, options) {
if( newValue === 'yes') {
alert('Yes')
} else {
alert('No')
}
}
}
See the API documentation for details.
Radio do not have a click event
Instead of the listeners try this:
handler: function(ctl, val) {
alert("ddd");
}
精彩评论