Sorting DESC on first column click instead of ASC
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior The current sorting behavior is working ASC on the first click and there is not any property to specify the the default sorting direction on the first click.
Expected behavior It would be great to have a property, lets say ‘sortingDirectionAtFirst’, where we could change the sorting direcction on the first click. currently the datatable is working very well, but there is not any way to change the direccion on the first click to DESC for all the columns.
<ngx-datatable
class="material"
[rows]="reportData"
[sortingDirectionAtFirst]="DESC">
</ngx-datatable>
What is the motivation / use case for changing the behavior? It would be nice to have the ability to change the sorting direction at the first click.
Please tell us about your environment:
- Table version: 10.2.3
- Angular version: 4.0.0
- Browser: All
- Language: TypeScript 2.4.2
Thank you
Issue Analytics
- State:
- Created 6 years ago
- Reactions:21
- Comments:10 (1 by maintainers)
Top Results From Across the Web
On Column Click, Order Descending by Default - DataTables
When sorting a column, the first click is always ascending order. two clicks are required to make the column show in descending order....
Read more >jQuery dataTables : Clicking thead should sort descending ...
Open a none minified jquery.dataTables.js and search for DataTable.defaults. To reverse the default ordering for all columns, so it becomes desc ...
Read more >Quick start: Sort data in an Excel worksheet - Microsoft Support
On the Data tab, in the Sort & Filter group, click Sort to display the Sort popup window. Sort command in the Sort...
Read more >Data Grid - Sorting - MUI X
Custom sort order ... In practice, when you click a column that is not sorted, it will sort ascending ( asc ). The...
Read more >DataTables order Option - GeeksforGeeks
value: This is a multi-dimension array value that specifies the rows and direction that the columns are to be sorted. The first value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Totally behind this idea - in almost every case, for our use cases, the first click would want to be descending, as opposed to ascending. Having this controllable as an option per column would be awesome.
Would second this request but would need it to be on a column by column basis. Example use case, We have a table of items with string and number columns. We want to configure the string columns to sort ascending by default and the numbers to sort descending by default.