通过选择此小提琴中的所有行:http: //jsfiddle.net/Hh8Ub/,您会注意到禁用的复选框(第 1、3 和 5 行)也被选中。我在 dojo 1.9 中看到过同样的行为
解决此问题的一种方法可能是修改toggleAllSelection
并运行一个函数 foreach 行以检查复选框是否首先被禁用,但我宁愿不这样做。
这是 toggleAllSelection 函数:
toggleAllSelection:function(checked){
// summary:
// Toggle select all|deselect all
// checked: Boolean
// True - select all, False - deselect all
var grid = this.grid, selection = grid.selection;
if(checked){
selection.selectRange(0, grid.rowCount-1);
}else{
selection.deselectAll();
}
this.toggleAllTrigerred = true;
},
提前致谢