Wednesday, 17 August 2016

Disable automatic sorting on the first column when using jQuery DataTables

Set the aaSorting option to an empty array. It will disable initial sorting, whilst still allowing manual sorting when you click on a column.

"aaSorting": []

You just need to add the following parameter to the DataTables options:

 "order": []

Set up your DataTable as follows in order to override the default setting:
 
$('#example').dataTable( { "order": [], // Your other options here... } );

No comments:

Post a Comment

Git merge branch to another branch

$ git checkout develop $ git pull $ git checkout test-branch $ git merge develop $ git push