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

Change empty cells to end of sort rather than start. #10

Open
LeeWannacott opened this issue Jan 29, 2021 · 5 comments
Open

Change empty cells to end of sort rather than start. #10

LeeWannacott opened this issue Jan 29, 2021 · 5 comments
Labels
good first issue Good for newcomers

Comments

@LeeWannacott
Copy link
Owner

Research what localeCompare considers the lowest value in JS for sort and change empty cells to this value (value#+i)nstead of i columnData.push("0#" + i); So white space ends up at the end of the table rather than the start when sorting.

@LeeWannacott LeeWannacott added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 29, 2021
@LeeWannacott
Copy link
Owner Author

Implemented in commits:
trim() to make it work for my website: 32da6e0,
fixing sort function + changing ZZZ to less likely to be used key X!Y!Z: 4344718,
ZZZ: ffa94b0

@LeeWannacott LeeWannacott self-assigned this Apr 15, 2021
@warmwhisky
Copy link

I am experiencing this issue where whitespace sorts to the top when sorting highest at top. Is there anything I must do to make it work?

@LeeWannacott
Copy link
Owner Author

@warmwhisky I'm guessing you are using order-by-desc and the whitespace is expected be at the bottom (on the first click)?

I just tested it out; I don't think what you are getting is the desired behavior.

We should put whitespace at the bottom when ordering by desc; I'll reopen the issue.

@LeeWannacott LeeWannacott reopened this Nov 28, 2022
@warmwhisky
Copy link

Sorry, yes I am using order-by-desc, but It's not only on the first click, whitespace is always at the top when sorting by descend.

We should put whitespace at the bottom when ordering by desc; I'll reopen the issue.

That would be great if you could fix it. I've been using DataTables for years, in most instances just for the sorting functionality. This package is a much lighter solution.

@LeeWannacott
Copy link
Owner Author

LeeWannacott commented Nov 29, 2022

Being at the top on the second click is currently the intended behavior, but I guess could have whitespace at the bottom on both accounts; it probably makes a bit more sense...

@LeeWannacott LeeWannacott removed the help wanted Extra attention is needed label Feb 19, 2023
@LeeWannacott LeeWannacott removed their assignment May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants