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

Multisort by default, without holding the sortMultiSortKey #1200

Closed
hmundt opened this issue Apr 26, 2016 · 3 comments
Closed

Multisort by default, without holding the sortMultiSortKey #1200

hmundt opened this issue Apr 26, 2016 · 3 comments
Labels

Comments

@hmundt
Copy link

@hmundt hmundt commented Apr 26, 2016

It would be nice to be able to use MultiSort by default instead of having to hold down the key specified in sortMultiSortKey. Is this possible with the current version or planned for the future?

@Mottie
Copy link
Owner

@Mottie Mottie commented Apr 26, 2016

Hi @hmundt!

It isn't documented (yet), but since the sortMultiSortKey option can be set to any event object, you can pick one that is pretty much always "truthy" (demo):

$(function () {
  $('table').tablesorter({
    theme: 'blue',
    // event.bubbles "should" always be true here
    sortMultiSortKey: "bubbles",
    // Use Ctrl + click to remove a column from sorting.
    sortResetKey: 'ctrlKey',
    widgets: ['zebra', 'columns']
  });
});

This might feel like a hack, so if desired, I could add another option to make the table multi-sort by default.

@hmundt
Copy link
Author

@hmundt hmundt commented Apr 29, 2016

This is perfectly sufficient for me.
Thank you for the support and for the continued development of this wonderful library.

@Mottie
Copy link
Owner

@Mottie Mottie commented Apr 30, 2016

I'm glad that worked for you!

@Mottie Mottie closed this Apr 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.