ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: jeff_b on December 23, 2015, 09:01:31 pm
-
I am using the provided editor a cell checkbox. The question is that once we leave the cell, it becomes true or false instead of leaving the check box.
Is there a way to disable this and keep the checkbox always displayed?
I have tried the following:
render: function (ui) {
var checked = (ui.rowData['AODBIndex'])
if (checked)
return ("<input type='checkbox' name='AO' checked='checked'>");
else
return ("<input type='checkbox' name='AO' >");
}
I have to set the checkbox to editable: false in order to keep the checkbox from becoming edit box so,
I combined this render function with a cellClick event for the checkbox cell that would toggle the value in a different cell based upon its current value.
ISSUE --> The issue with this method, the cells are never marked as dirty and therefore not sent to the database when the user clicks AcceptChanges.
Is there an easier way of doing this?
OR is there a way to manually tell paramgrid that a cell has in fact changed? (I don't mind if its a not cleared once I change the value back)
-
As it is not supported directly through public API of the grid, you have to manually call grid.iUCDate.update ( ) where grid is pqgrid javascript instance obtained by
$grid.data("paramqueryPqGrid"); or $grid.pqGrid( 'instance' );
grid.iUCData.update({
rowData: rowData,
dataIndx: dataIndx,
oldVal: oldVal,
newVal: newVal
})