gpt4 book ai didi

javascript - 如何用 ExtJS 监听单选按钮是否被选中?

转载 作者:行者123 更新时间:2023-11-30 10:47:36 25 4
gpt4 key购买 nike

{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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com