CheckBox,动作事件

时间:2012-07-09 12:36:22

标签: extjs extjs4 extjs4.1

我需要添加Check box,并在用户checks上添加(如更改值check/uncheck)以打印console.log语句。到目前为止,我能够显示复选框,但无法访问其检查事件。

{
    xtype: 'checkboxgroup',
    columns: 1,

    listeners: {
        change: function (this, newValue, oldValue, eOpts) {
            console.log('change');
            console.log(newValue);
        }
    },
    items: [{
        boxLabel: 'Cars',
        name: 'chk1',
        inputValue: '1'
    }]
}

1 个答案:

答案 0 :(得分:6)

对于任何其他字段,change事件应该有效。

示例:http://jsfiddle.net/mbbjz/2/