I have two checkbox columns on slick grid and cannot at the moment get the checkboxes to work appropriately. If you check on one side the other side also gets checked, if you select all on either side both sides all get checked. Is there a way to overload the registerplugin on slickgrid to make both checkboxes behave individually?
I had something like this in mind.
switch (new checkboxselected().getcolumn()) {
case checkboxApprove = grid.registerPlugin(checkboxApprove),
break
case checkboxDeny = grid.registerPlugin(checkboxDeny)
}
var checkboxApprove = new Slick.CheckboxSelectColumn({
cssClass: "slick-cell-checkboxsel"
});
columns.push(checkboxApprove.getColumnDefinition());
var checkboxDeny = new Slick.CheckboxSelectColumn({
cssClass: "slick-cell-checkboxsel"
});
columns.push(checkboxDeny.getColumnDefinition());
$(function () {
for (var i = 0; i < 10; i++) {
var d = (data[i] = {});
d["title"] = "Task " + i;
}
grid = new Slick.Grid("#myGrid", data, columns, options);
grid.setSelectionModel(new Slick.RowSelectionModel({selectActiveRow: false}));
grid.registerPlugin(checkboxApprove);
grid.registerPlugin(checkboxDeny);
var columnpicker = new Slick.Controls.ColumnPicker(columns, grid, options);
grid.render();
The issue is that you don't have a unique column id for each column. They are both using the default id (_checkbox_selector
) and therefore wind up interacting. This is an educated guess since I cannot test it at the moment.
You should be able to fix it by adding a column id to the options passed in:
var checkboxDeny = new Slick.CheckboxSelectColumn({
columnId: "_checkbox_selector_deny"
cssClass: "slick-cell-checkboxsel"
});