angular-datatables
angular-datatables copied to clipboard
How to set sort Descending for column ?
Hi!
i want to set sort Descending for ID column , but i don't know how to set . Could you give me a favor?
p/s: I use the example "Angular way" from http://l-lin.github.io/angular-datatables/#/angularWay
According to the DataTable documentation, you need to add an order option.
So it will look like something like this:
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('order', [3, 'desc']); // Replace 3 with the index of your `ID` column
See Plnkr for a complete example.
Thank you very much :)
Hi, Is there any way to set this 'order' on column name instead of index?
Thanks