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

Sorting new feature #356

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Sorting new feature #356

wants to merge 5 commits into from

Conversation

ekarudianto
Copy link

I found a bug when I do a sorting based on date, it doesn't sorted out right because it's sorted based on string.. I manage to made a workaround by adding new option which is

sortableType

the default value would be "string" but it could be a date as well.. and also I remove the sorting case sensitive by converting all the strings into lower case

I reallly hope this helps you Jos ! and please review my code if you have time and see if I missed something :)

@josdejong
Copy link
Contributor

Good point, thanks. The sorting now always orders by string value. I think your solution is nice but we can implement a more generic solution by allowing people to provide their own comparator. This allows you to create a custom compare function for every sort of data, not just number, string, and Date. It should be possible to configure a comparator for each individual column.

As for your specific use case: it may be better to provide the date dateEnter as a timestamp or ISOString, and use a format function to display it in a form like "30 Nov, 2015".

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.

2 participants