Posted 6 February 2019, 12:09 pm EST
Let me add, I am trying to accomplish this in script, see the code below (which comes from my item formatter function) for how my code is structure:
code for the select:
formatWorklistItemsCell: function (grid, args) {
if (grid.columns.length === 0)
return;
let colName = grid.columns[args.col].name;
switch (colName) {
case this.Col_Select:
args.cell.innerHTML = '<input type="checkbox"/>';
let cb = args.cell.firstChild;
let row = args.panel.rows[args.row];
if (args.panel.cellType === wijmo.grid.CellType.ColumnHeader) {
args.cell.classList.add("wlctl");
cb.checked = grid.selectedRows.length > 0;
cb.indeterminate = grid.selectedRows.length > 0 && grid.selectedRows.length < grid.rows.length;
cb.addEventListener("change", e => {
// grid.refresh(args); // didn't work
// calls another function here to do some other work
});
}
else if (args.panel.cellType === wijmo.grid.CellType.Cell) {
grid.columns[args.col].cssClass = "wlctl wlsel";
if (row.isSelected) {
cb.checked = true;
grid.updateRowSelection(null, row, args.panel.cellType, row.isSelected); // ensure in selected list
}
cb.addEventListener("change", e => {
//grid.refresh(args); // didn't work
// calls another function here to do some other work
});
}
break;
here is the case statement for the button cell, in the same method:
case this.Col_ImgButton:
if (args.panel.cellType === wijmo.grid.CellType.Cell) {
let row = args.panel.rows[args.row];
if (row.isSelected) {
args.cell.innerHTML = '<span><i style="color: var(--text-call-to-action); font-weight: normal;" class="icon--xs icon-expand-all"></i></span>';
let det = args.cell.firstChild;
det.addEventListener("click", () => {
this.loadDetails();
});
}
grid.columns[args.col].cssClass = "wlctl wldetails";
}
break;