aoColumnDefs '_all' bSortable:false overriding individual column bSortable:true
aoColumnDefs '_all' bSortable:false overriding individual column bSortable:true
Hi all,
I'm trying to configure a table that has only the first and last two columns sortable and the number of columns is variable. I'm doing this by using aoColumnDefs to set default unsortable behaviour and enabling sorting for the required columns only with the code:
"bSort": true,
"aaSorting": [[ 0, 'asc' ]],
"aoColumnDefs": [
{ "aTargets": [ 0 ], "bSortable": true },
{ "aTargets": [ -1 ], "bSortable": true },
{ "aTargets": [ -2 ], "bSortable": true },
{ "aTargets": [ '_all' ], "bSortable": false }
]
This correctly enables sorting just for the targeted columns, however the sortable columns that are not currently selected for sorting have their class set to 'sorting-disabled' instead of 'sorting' so the sorting icon is not shown. If you select sorting on a different column, the class is correctly set to 'sorting-asc' but the original column has it's class reset to 'sorting-disabled' and the sort control icon disappears. I'm using v1.8.0. Any ideas?
cheers :)
rups
I'm trying to configure a table that has only the first and last two columns sortable and the number of columns is variable. I'm doing this by using aoColumnDefs to set default unsortable behaviour and enabling sorting for the required columns only with the code:
"bSort": true,
"aaSorting": [[ 0, 'asc' ]],
"aoColumnDefs": [
{ "aTargets": [ 0 ], "bSortable": true },
{ "aTargets": [ -1 ], "bSortable": true },
{ "aTargets": [ -2 ], "bSortable": true },
{ "aTargets": [ '_all' ], "bSortable": false }
]
This correctly enables sorting just for the targeted columns, however the sortable columns that are not currently selected for sorting have their class set to 'sorting-disabled' instead of 'sorting' so the sorting icon is not shown. If you select sorting on a different column, the class is correctly set to 'sorting-asc' but the original column has it's class reset to 'sorting-disabled' and the sort control icon disappears. I'm using v1.8.0. Any ideas?
cheers :)
rups
This discussion has been closed.