Multisort by default, without holding the sortMultiSortKey #1200

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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Apr 26, 2016

Owner

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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@hmundt

hmundt Apr 29, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Apr 30, 2016

Owner

I'm glad that worked for you!

Owner

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