l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 486 forks source link

set default sort options for individual colmns #1669

Closed nizalsha closed 2 years ago

nizalsha commented 2 years ago

:rocket: Feature request

Default sorting in individual columns.

I have data from the server, it is not in the right order, so I want to set the data in the table as sorted, need an option to set the sort ASC, DSC option for individual columns in dtoptions, it would be more helpful so can avoid lines codes to sort the data.

shanmukhateja commented 2 years ago

Hi,

There is support for single column sort here.

However, setting order for individual columns is not supported by this library. As you might now, it's a wrapper around datatables.net jQuery plugin. You might have more luck with their forums.

You can use order option which accepts an array of columns with individual ASC or DESC values.

Reference: https://datatables.net/reference/option/order

shanmukhateja commented 2 years ago

Closing this as response was not provided.