Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AG-Grid sorting is not working with TreeData #1270

Closed
shafaqkazmi opened this issue Nov 18, 2016 · 2 comments
Closed

AG-Grid sorting is not working with TreeData #1270

shafaqkazmi opened this issue Nov 18, 2016 · 2 comments

Comments

@shafaqkazmi
Copy link

I have an ag-grid with Tree Data. (https://www.ag-grid.com/javascript-grid-tree/).

I am facing an issue that column is being sorted in lexicographical order instead of Asc/Desc. For number columns, it should be sorted by max/min value. Here is the JsFiddle link: https://jsfiddle.net/pbjqdw6w and see the behavior of Currency column.

Need help urgently!

@ceolter
Copy link
Contributor

ceolter commented Dec 2, 2016

for custom sorting, use colDef.comparator
explained here:
https://www.ag-grid.com/javascript-grid-sorting/

@ceolter ceolter closed this as completed Dec 2, 2016
@shafaqkazmi
Copy link
Author

@ceolter Thanks for the fix. It's working after using colDef.comparator

comparator: function (valueA, valueB, nodeA, nodeB, isInverted) {
  return valueA - valueB;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants