CheckBox,动作事件

Raz*_*era 5 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'
    }]
}
Run Code Online (Sandbox Code Playgroud)

CD.*_*D.. 6

对于任何其他字段,更改事件应该起作用.

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