-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add support for "disable-sort" class per column #57
Conversation
Hey @vhtkrk In #51 they are talking about excluding rows from being sorted; whereas this is disabling the sort on the click of columns. I'm wondering whether this feature should also freeze the column in place, another-words if the user clicks on another column the column that has However, it may be a bit tricky to implement considering table-sort-js sorts the What are your thoughts? are you up for trying to implement this? 🤔 Thanks. |
Hmmmm after further thought; maybe there is a use case where if a user clicks on a column and it doesn't sort properly; so you want to disable it. Maybe the freezing a column should be a different class. Could you add documentation for |
Thanks for your input. I actually have a use case for just what I made: I have a bunch of rows where there's either "First name" and "Last name" as separate fields, or just a "Name" field that has both in it. The easiest way to fit in with other requirements was to stuff it into a table with 2 columns: "Name" and another one with an empty heading. Then in a loop I either put the full name in the first column or the first name in the first column and last name in the second. But sorting by that second field was confusing, especially when the column header has no text. I'll have to see what it would take to freeze the columns so they won't be sorted at all, but that sounds like it's a bit more work than this, so no promises as I don't have immediate use for it myself. But I agree it should be a different feature from this one. I'll update the docs tomorrow or Sunday if I don't find the time tomorrow. |
OK cool; I never thought of that use case.
Yeah, I wouldn't worry about freezing the column for this PR; can do that as a separate feature.
All good, just whenever is convenient 👍 |
I've updated the documentation. Also added missing |
Looks good to me! Merged in commit: c8d4273 and new release: https://github.com/LeeWannacott/table-sort-js/releases/tag/1.7.9 |
Resolves #7. And maybe #51 too but I'm not 100% sure if that's what they asked for.