Sorting with checkbox as the first column
Sorting with checkbox as the first column
I have a fair simple datatable with id in the first column, checkbox at the second column.
The first column invisible and the second column (the checkbox disappear), so the first load the sorting arrow is disappear with this setting
$('#example').dataTable({
"bRetrieve": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0] },
{ "bVisible": false, "aTargets": [0] },
{ "bSortable": false, "sSortDataType": "dom-checkbox" , "aTargets": [1] }
]
});
My checkbox in the html is simply like that
However, after the sorting.
The sorting arrow for the check box column appears again.
The first column invisible and the second column (the checkbox disappear), so the first load the sorting arrow is disappear with this setting
$('#example').dataTable({
"bRetrieve": true,
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [0] },
{ "bVisible": false, "aTargets": [0] },
{ "bSortable": false, "sSortDataType": "dom-checkbox" , "aTargets": [1] }
]
});
My checkbox in the html is simply like that
However, after the sorting.
The sorting arrow for the check box column appears again.
This discussion has been closed.
Replies
[code]
aaSorting: [[ 1, 'asc' ]]
[/code]
to your DataTables initialisation and that should do it.
Allan
Any column i added the bSortable:false looks good at the beginning. The sorting triangle is not there
Then after a click.They resume to normal. The sorting triangle is still there.
Allan