日期:2014-05-16  浏览次数:20412 次

extjs4 checkGroup和radioGroup如何绑定check事件
现在在学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
} ]
}]
});

此代码显示没问题,但是选中与取消选中复选框时不会触发事件,请问该怎么写
extjs4 checkGroup radioGroup check事件

------解决方案--------------------
解决了就好。
------解决方案--------------------
试一下把listeners 里的"check"双引号去掉