Order the table by the selected column.
This method provides a useful alternative to the
order() method, allowing you to select the column that you want to be ordered using the flexible
column() selector and having it ordered in the direction specified.
Please be aware that this method sets the ordering to apply to the table - it does not actually perform the order. In order to have the order performed, use the
draw() method, which can be called simply as a chained method of the
order() method's returned object - for example
function column().order( direction )
Sort by the first visible column:
var table = $('#example').DataTable(); table .column( '0:visible' ) .order( 'asc' ) .draw();
The following options are directly related and may also be useful in your application development.