I have gone through the column sorting in jQuery datatable plugin and the various ways of controlling it.. I have a query is it possible to control sorting in such a way that clicking on upper arrow icon will do sorting in ascending order & down arrow icon will do sorting in descending order??
I have gone through the column sorting in jQuery datatable plugin and the various
Share
There is two way of doing that, depending on
datatablesversion.EDIT for Datatables version 1.9 or less
You need to use
fnHeaderCallback. With this callback you can edit everythelement in table header.I have create a working example for you.
LIVE :
http://live.datatables.net/oduzovCODE :
http://live.datatables.net/oduzov/edit#javascript,htmlHere is code behind that (open snippet to see the code) :
For Datatables version 1.10 and newer
callback have a new name, it’s just
headerCallback. Everything else is the same, so use new callback insted of legacy api.