Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

[Feature Request] Expose comparator per column. sortValue does not work for special cases. #674

Open
ntodorov opened this issue Jan 16, 2018 · 0 comments

Comments

@ntodorov
Copy link

sortValue is a great helper, but not enogh in my case. Please see https://jsfiddle.net/ntodorov/3zaw3hdr/
The gist of it - if you have a column with values like paragraph numbers:

var numbers = [{pn: "2.10"}, 
  {pn: "66.9.90008.56.5"}, 
  {pn: "1.1"},
  {pn: "1.2"},
  {pn: "1.12"},
  {pn: "2.10.1"},
  {pn: "2.10.4"},
  {pn: "0"}];

just giving formated option does not cut it. Better to say I do not see it working with different dot levels that need to be compared. One could have 0 dots the other 5, meaning the comparator needs to compare level by level.

In my jsfiddle the issue is visible and my comparator there sorts perfectly, but I cannot attach it to the column. If you click on the title, it ignores the custom comparator of the collection and creates internal that sorts as a string and that's not the desired order.

Is it possible to expose a property for comparator?

Thanks,
Nik

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

No branches or pull requests

1 participant