Skip to content

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