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

Grouping: group_collapsed #1247

Closed
mtgtnt opened this issue Jul 8, 2016 · 6 comments
Closed

Grouping: group_collapsed #1247

mtgtnt opened this issue Jul 8, 2016 · 6 comments

Comments

@mtgtnt
Copy link

mtgtnt commented Jul 8, 2016

when setting group_collapsed: true
it does nothing. Am I missing something?
http://jsfiddle.net/bu3wha9d/

@Mottie
Copy link
Owner

Mottie commented Jul 8, 2016

Hi @mtgtnt!

Hmm, that looks like a bug.

It looks like what happened is when the group_saveGroups option was added to save which groups were collapsed, it overrode the intended behavior. If you set the group_saveGroups to false, all headers will start collapsed.

I'll see if I can find a solution, or at the very least update the documentation.

@Mottie
Copy link
Owner

Mottie commented Jul 8, 2016

Here's a demo... I had to add a reset button to clear out the saved groups before it would behave.

@mtgtnt
Copy link
Author

mtgtnt commented Jul 8, 2016

This is working great for initial load of table. Now the next part is when the table changes, for example with an ajax call. Using .trigger("update") will not collapse the rows.

@Mottie
Copy link
Owner

Mottie commented Jul 8, 2016

If you still have group_saveGroups set as true, then you'll need to clear out the saved groups before triggering an update (demo)

$('.update').click(function() {
  // don't pass this function the $table jQuery object
  $.tablesorter.grouping.clearSavedGroups($table[0]);
  $table.trigger('update');
});

@mtgtnt
Copy link
Author

mtgtnt commented Jul 8, 2016

I had just put the same thing together and about to post my findings. You beat me to it :)

@Mottie
Copy link
Owner

Mottie commented Jul 11, 2016

A new release is now available!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants