{xtype : 'radiogroup',
items : [{
boxLabel : 'jjj',
name : 'tyutrfytr',
inputValue : 1,
checked : true
}, {
boxLabel : 'kkk',
name : 'dfdsfdsddd',
inputValue : 2,
listeners: {
check : function(cb, rec, ind) {
alert('hhhh');
}
}
}]
}
无论我是按第一个选项还是第二个选项,上面的代码都会给出 alert
。它不应该只在选中第二个选项时才发出警报吗?
最佳答案
每当 radio 被选中或未被选中时,事件就会触发。
check : ( Ext.form.Checkbox this, Boolean checked ) 选中或取消选中复选框时触发。 将使用以下参数调用监听器: 这个:Ext.form.Checkbox 这个复选框 检查: bool 值 新勾选值
listeners: {
check : function(cb, value) {
if (value) alert('check');
else alert('uncheck');
}
}
关于javascript - 如何用 ExtJS 监听单选按钮是否被选中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7348065/