仅隐藏 slickgrid 标题行中的复选框
代码1:
var checkboxSelector = new Slick.CheckboxSelectColumn({
cssClass: "slick-cell-checkboxsel"
});
tempColumns.push(checkboxSelector.getColumnDefinition());
代码2:
tempGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false}));
tempGrid.registerPlugin(checkboxSelector);
我正在使用上面的代码显示复选框列。
如何仅从 slickgrid 的标题行隐藏复选框? (图中红色圆圈下)
谢谢。
Code1:
var checkboxSelector = new Slick.CheckboxSelectColumn({
cssClass: "slick-cell-checkboxsel"
});
tempColumns.push(checkboxSelector.getColumnDefinition());
Code2:
tempGrid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow:false}));
tempGrid.registerPlugin(checkboxSelector);
I am using the above code to show the checkbox column.
How to hide checkbox only from header row of a slickgrid? (under red circle in the image)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我能够做到这一点,但我的解决方案是注释掉 slick.checkboxselectcolumn.js 文件中的几行。据我所知,
handleSelectedRowsChanged()
实际上在每次更改时都会使用新的元素重写复选框单元格标题的内容 - 它不仅仅是更改选中的属性。因此,我注释掉了该函数中进行交换的行,以及在 init 处添加复选框的其他一些行以及用于(取消)全选的事件。
https://gist.github.com/1085623
可能有更好的方法来解决这个问题,但我需要尽快把东西拿出来。
I was able to do this, but my solution was to comment out a few lines in the
slick.checkboxselectcolumn.js
file. From what I can tell,handleSelectedRowsChanged()
actually rewrites the contents of the checkbox cell header with a new<input>
element on every change -- it doesn't just change the checked attribute. So I've commented out the lines in that function that make the swap, as well as a few others that add the checkbox at init and the event to (de)select all.https://gist.github.com/1085623
There's probably a better way to approach this, but I needed to get something out the door ASAP.
您可以使用 jQuery 删除该复选框。
但是,标题行上的复选框允许您执行“全部选中”。您确定要删除它吗?
You can use jQuery to remove the checkbox.
However, that checkbox on the header row allows you to do "Check All". Are you sure you want to remove it?