我有个ColumnModel,想当点击ColumnModel上的列显示/隐藏,选中一列,触发hiddenchange事件。以下是我的代码。
var cm = new Ext.grid.ColumnModel([
            sm,
            new Ext.grid.RowNumberer({ width: 28 }),
            { header: "标题", width: 100, sortable: true, dataIndex: 'name', renderer: LoadFileName, hidden: true },
            { header: "签发状态", width: 40, sortable: false, dataIndex: 'status', renderer: LoadStatus },
            { header: "审核状态", width: 40, sortable: true, dataIndex: 'audit', renderer: LoadAudit },
            { header: "对象类别", width: 40, sortable: true, dataIndex: 'objecttype', renderer: LoadObjectType },
            { header: "修改人", width: 40, sortable: true, dataIndex: 'creator', renderer: LoadUserName },
            { header: "创建时间", width: 40, sortable: true, dataIndex: 'createtime', hidden: 2 == 2 },
            { header: "修改时间", width: 40, sortable: true, dataIndex: 'inputtime', hidden: 3 != 3 }
        ]);
            cm.on('hiddenchange',function(cm,columnIndex){
//监听的具体内容 
alert(columnIndex);
});
现在问题在这里cm.on('hiddenchange',function(cm,columnIndex){
//监听的具体内容 
alert(columnIndex);
});
当只有2个参数cm,columnIndex的时候能正常运行。
当有3个参数cm,columnIndex,true/false的时候就不能正常运行会报错。(应为标识符)。
根据API这里是应该有3个参数呀。true/false是表示当某一列隐藏或“反隐藏”时触发。但为什么不能运行呢?