admin管理员组文章数量:1279008
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.
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.
Share Improve this question asked Jul 15, 2011 at 16:32 YellowcakeYellowcake 1163 silver badges9 bronze badges3 Answers
Reset to default 8grid.onHeaderRowCellRendered.subscribe(function (e, args) {
if (args.column.id === '_checkbox_selector') {
// do something if you want
} else {
$(args.node).empty();
$('<input type="text">')
.data('columnId', args.column.id)
.val(columnFilters[args.column.id])
.appendTo(args.node);
}
});
I was able to do this, but my solution was to ment 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 mented 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./1085623
There's probably a better way to approach this, but I needed to get something out the door ASAP.
You can use jQuery to remove the checkbox.
$('.slick-header-columns input[type="checkbox"]').remove();
However, that checkbox on the header row allows you to do "Check All". Are you sure you want to remove it?
本文标签: javascriptHide checkbox only from header row of a slickgridStack Overflow
版权声明:本文标题:javascript - Hide checkbox only from header row of a slickgrid - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741281642a2370041.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论