var sm = new Ext.grid.CheckboxSelectionModel();
sm.handleMouseDown = Ext.emptyFn;//不响应MouseDown事件
sm.on('rowselect',function(sm_,rowIndex,record){//行选中的时候
}, this);
sm.on('rowdeselect',function(sm_,rowIndex,record){//行未选中的时候
}, this);
new Ext.grid.CheckboxSelectionModel({
listeners:{
'rowselect':function(sm,rowIndex,record){
console.log('rowselect',rowIndex)
},
'rowdeselect':function(sm,rowIndex,record){
console.log('rowdeselect',rowIndex)
},
'selectionchange':function(sm){
console.log('selectionchange',sm.getSelections().length);
}
}
本文介绍如何使用ExtJS中的CheckboxSelectionModel来自定义网格的选择行为,包括禁用MouseDown事件响应及监听行选择和取消选择事件。


被折叠的 条评论
为什么被折叠?



