angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

How to set sort Descending for column ?

Open heavyrajn opened this issue 12 years ago • 3 comments

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

heavyrajn avatar Jul 22 '14 07:07 heavyrajn

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.

l-lin avatar Jul 22 '14 07:07 l-lin

Thank you very much :)

heavyrajn avatar Jul 22 '14 08:07 heavyrajn

Hi, Is there any way to set this 'order' on column name instead of index?

Thanks

ajmashaid-nisum-com avatar Aug 10 '17 14:08 ajmashaid-nisum-com