extjs4 checkGroup和radioGroup如何绑定check事件

xjhjf080808 2013-02-06 02:57:41
现在在学extjs4,遇到个问题,无法给checkGroup和radioGroup绑定check事件, 包括其中的checkbox和radio也无法绑定,贴上代码:
var radioPanel = Ext.create("Ext.panel.Panel", {
id : "radioPanel",
title : "单选框Panel",
flex : 1,
renderTo : "orderInfoPage",
items : [ {
xtype : "radiogroup",
id : "dd_s",
fieldLabel : "属性dd",
name : "dd_s",
items : [ {
boxLabel : "Item 1",
name : "dd_s",
inputValue : 1,
listeners : {
"check" : function(el, checked) {
alert(1);
if (checked) {//只有在点击时触发
alert(2);
}
}
}
}, {
boxLabel : "Item 2",
name : "dd_s",
inputValue : 2,
checked : true
}, {
boxLabel : "Item 3",
name : "dd_s",
inputValue : 3
} ]
}]
});

此代码显示没问题,但是选中与取消选中复选框时不会触发事件,请问该怎么写
...全文
892 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
josephSC 2013-02-14
  • 打赏
  • 举报
回复
跳过我楼上的回复,回复没经大脑。extjs4 radiogroup 是没有 "check" 事件的只有"change"事件
josephSC 2013-02-14
  • 打赏
  • 举报
回复
试一下把listeners 里的"check"双引号去掉
弘毅致远 2013-02-06
  • 打赏
  • 举报
回复
解决了就好。
xjhjf080808 2013-02-06
  • 打赏
  • 举报
回复
现在无奈先用了change事件

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧