Sorting a DataTables checkbox column (success but maybe not correct way)

Sorting a DataTables checkbox column (success but maybe not correct way)

mcgrevymcgrevy Posts: 35Questions: 0Answers: 0
edited October 2012 in Editor
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

Replies

  • mcgrevymcgrevy Posts: 35Questions: 0Answers: 0
    Hi All,
    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
This discussion has been closed.