Sorting a DataTables checkbox column (success but maybe not correct way)
Sorting a DataTables checkbox column (success but maybe not correct way)
Hi Alan
I want to sort a checkbox column and have managed it BUT given all the documentation on "sSortDataType": "dom-checkbox", etc I can't help but think I am over engineering this. Your comments will be appreciated.
My code is :-
[code]
{"sType": "html", //6 mandateSigned
"sWidth": "20px",
"fnRender": function (oObj) {
var $checked = '';
if (oObj.aData[6] == '1') {
$checked = "checked='checked'";
}
return ""+oObj.aData[6]+'';
}
},
[/code]
The class is there purely to center the checkbox. The default style puts it to the left half outside the
I want to sort a checkbox column and have managed it BUT given all the documentation on "sSortDataType": "dom-checkbox", etc I can't help but think I am over engineering this. Your comments will be appreciated.
My code is :-
[code]
{"sType": "html", //6 mandateSigned
"sWidth": "20px",
"fnRender": function (oObj) {
var $checked = '';
if (oObj.aData[6] == '1') {
$checked = "checked='checked'";
}
return ""+oObj.aData[6]+'';
}
},
[/code]
The class is there purely to center the checkbox. The default style puts it to the left half outside the
This discussion has been closed.
Replies
I have now found out why the above solution is NOT Ok. The value is not correctly reflected in the Edit form. The check box is always set to false. Obviously the HTML I insert is not allowing Editor to find a value of zero or one.
Will look further and post again when I find a solution. In the meantime any help will be appreciated.
Regards
Roger