Hi, I upgraded to 3.2 version. We are saving the checkbox selection and when user return to the page, we render the checkbox as per previously selected values.
Previously working code -
{ title: "", maxWidth: 20, minWidth: 20, align: "center", resizable: false,
type: 'checkBoxSelection', cls: 'ui-state-default', sortable: false, editable: false,
cb: { all: true, header: true },
render: function (ui) {
var rowData = ui.rowData, dataIndx = ui.dataIndx;
var val = rowData["PROCEDURE_ID"];
str = "";
if(selectedProcJSON) {
$.each(selectedProcJSON, function(index, value) {
if (val==selectedProcJSON[index]["id"]) {
str = "checked='checked'";
ui.rowData[0]=true;
return false;
}
});
}
return "<input type='checkbox' " + str + " />";
}
},
I changed it to below due to upgrade.
{ title: "<label><input type='checkbox' /></label>",align: "center", resizable: false,
type: 'checkbox', cls: 'ui-state-default', sortable: false,
dataType: 'bool',
cb: { all: true, header: true, select: true},
render: function (ui) {
var rowData = ui.rowData, dataIndx = ui.dataIndx;
var val = rowData["PROCEDURE_ID"];
str = "";
if(selectedProcJSON) {
$.each(selectedProcJSON, function(index, value) {
if (val==selectedProcJSON[index]["id"]) {
str = "checked='checked'";
ui.rowData[0]=true;
return false;
}
});
}
return "<input type='checkbox' " + str + " />";
},
// editable: true
},
Still it is not working.
Seems like due to some change in render function, it is called for each cell click and it always makes checkbox unchecked. Please help.