question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default Sort Not Working / Not Documented.

See original GitHub issue

I’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

Current behavior

Default Sorting does not work Expected behavior

Have a way to be able to define which column to sort by at the start.

Reproduction of the problem

http://plnkr.co/edit/TLx2vYlCTLsqcLwvWafd is broken, if you can provide me a different plnkr I will post a repro What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Table version: 0.7.x
  • Angular version: 2.0.x
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:24 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
mikebuckley5commented, Aug 21, 2017

According to the commit from @marjan-georgiev it looks like its done like this:

<ngx-datatable [sorts]="[{prop: 'name', dir: 'desc'}]">...

default_sort
4reactions
RicardoVarandacommented, Feb 16, 2017

@yaotzin68 rather than waiting I did the sort myself with the help of underscore:

this.rows = _.sortBy(pages, function (o) {
          return parseInt(o['page_number']);
        });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Material table default sorting does not work - Stack Overflow
I have the following mat-table , but the sorting function is not working.. From what I can tell I have followed the instructions...
Read more >
Unable to permanently sort columns within SharePoint ...
I have modified the document library's sort options within SharePoint - however, it does not seem to carry over to Teams.
Read more >
Default Sort functionalty not working correctly when on ...
After implementing on-demand loading of data the default column-sort functionality is working inconsistently.
Read more >
WooCommerce default sort by price not working | WordPress.org
Hello,. I have a web shop (OceanWP theme) that has default sorting set to price ascending. When I enter the shop, prices are...
Read more >
Data Grid - Sorting - MUI X
If null or undefined , the rule will not be applied. Initialize the sort model. Sorting is enabled by default to the user....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found