I am trying to get checkboxes in a grid to save so I can update a database. Don't know if this is possible in the non-pro version, and can't find any documentation on it.
Here's some code:
var colM = [
{ title: "ID", width: 60, hidden:true },
{ title: "Name" },
{ title: "Freeze" ,dataIndx: 11, editable: true, sortable: false, width: 30, align: "center", resizable: false, render: function (ui) {
var rowData = ui.rowData, dataIndx = ui.dataIndx;
var val = rowData[dataIndx];
str = "";
if (val == 1) {
str = "checked='checked'";
}
return "<input type='checkbox' " + str + " />";
},
saveCell: function (ui) {
console.log('ui',ui)
// Here I would like to update the database using a $.post function
}
}
Then I set the colModel option to the colM object above. This renders the checkbox ok and checks the right ones according to the data, but when I uncheck or check them I can't get anything out of the saveCell function. I have already checked whether another function is clashing with it. Does anyone know the proper way to do this?
I also have the problem of the state of the checkbox not saving in the client when I scroll the grid, which was mentioned elsewhere but not answered.