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

Adding natural sorting as a sorting strategy #1424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ClosedEyesSeeing
Copy link

Using the 'numeric' and 'sensitivity' options in localCompare to provide a Natural Sort strategy.

This will keep the original intended sorting in place but provide an alternative for those that wish to use natural sorting for alphanumeric characters.

Example:

Normal string sort

  1. Item 1
  2. Item 10
  3. Item 2

Natural sort:

  1. Item 1
  2. Item 2
  3. Item 10

Usage is the same as any other sort strategy in jsGrid:

{ fields: [ ... { name: "Name", sorter: "stringNaturalSort" }, ... ] }

Using the 'numeric' and 'sensitivity' options in localCompare to provide a Natural Sort strategy.
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

Successfully merging this pull request may close these issues.

1 participant