How can I make a column non-sortable?
How can I make a column non-sortable?
Hi,
I have a table with 4 columns. The first 3 should be sortable, the fourth only contains action links and should therefore not have a sort icon in the header.
I've managed to get this behavior by only specifying three columns in the aoColumns array. But then I get the following warning:
DataTables warning (table id = 'CurrentTasks'): Unexpected number of TD elements. Expected 208 and got 416. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
Everything else seems to work fine though.
By Specifying null as the fourth aoColumns element I can get around the warning, but then the column is sortable again.
How can I get rid of the warning and still keep the fourth column as non-sortable?
Thanks,
Adrian
I have a table with 4 columns. The first 3 should be sortable, the fourth only contains action links and should therefore not have a sort icon in the header.
I've managed to get this behavior by only specifying three columns in the aoColumns array. But then I get the following warning:
DataTables warning (table id = 'CurrentTasks'): Unexpected number of TD elements. Expected 208 and got 416. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.
Everything else seems to work fine though.
By Specifying null as the fourth aoColumns element I can get around the warning, but then the column is sortable again.
How can I get rid of the warning and still keep the fourth column as non-sortable?
Thanks,
Adrian
This discussion has been closed.
Replies
http://www.datatables.net/usage/columns
and scroll down to bSortable. in your aoColumns, you need to add { "bSortable": false } for the column(s) you dont want to be sortable.
Hope that helps.
-Matthew