我有一个grid
,我想通过单击一个特定的单元格来选择整个记录。问题是我不能使用checkboxmodel
seltype
,因为我想在每个单元格上显示自定义图标。那么有什么办法可以实现呢?
我通过beforecellclick
事件解决了问题。现在看起来像这样:
beforecellclick:function(grid,record,index){
if(index != 0){
return false
}
}
我在colIndex 0上有一个操作列:
xtype: 'actioncolumn',
tooltip:'löschen',
width: 30,
icon: '../../../../../../resources/images/16/delete_2.png',
handler:function(grid, rowIndex, colIndex){
var record = grid.getStore().getAt(rowIndex);
if( grid.getSelectionModel().isSelected(record) == false){
grid.getSelectionModel().select(record, true)
}else{
grid.getSelectionModel().deselect(record)
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句