I tried Oleg clickable checkbox formatter recently posted in trirand.com forum.
Code below from other answer is used.
It finds boolean Kinnitatud column value in loadComplete.
Code below stops working with clickable checkbox formatter .
$(row.cells[iCol]).children("input:checked").length > 0; condition is always false
even if boolean column has value true.
How to make it work ?
It works with standard checkbox formatter.
{ "name":"Kinnitatud","edittype":"checkbox",
"formatter":"clickableCheckbox",
"editable":true,"width":0,"classes":null,"hidden":true,
}
var LoadCompleteHandler = function () {
var iCol = getColumnIndexByName($grid, 'Kinnitatud'),
cRows = $grid[0].rows.length,
iRow,
row,
className,
changeBackGround;
for (iRow = 0; iRow < cRows; iRow = iRow + 1) {
row = $grid[0].rows[iRow];
className = row.className;
if ($.inArray('jqgrow', className.split(' ')) > 0) {
// changeBackGround is always false if formatter = "clickableCheckbox" is used:
changeBackGround = $(row.cells[iCol]).children("input:checked").length > 0;
}
}
The code can be fixed in very easy way. In the new ‘clickableCheckbox’ formatter the
<input>in not direct child of the<td>. The cell contain isSo you should replace
$(row.cells[iCol]).children("input:checked")to$(row.cells[iCol]).find(">div>input:checked").