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

Keep groups collapsed when editing (feature request) #514

Closed
terwarf opened this issue Feb 25, 2014 · 4 comments
Closed

Keep groups collapsed when editing (feature request) #514

terwarf opened this issue Feb 25, 2014 · 4 comments

Comments

@terwarf
Copy link

terwarf commented Feb 25, 2014

Hi Mottie,

thanks a lot for fixing #487, works like a charm for me.
There's one additional wish from me:
When you have some groups collapsed and edit a row in another group, all groups extend again - on long lists this mean you'll lose focus on the row.
Would be very nice to keep collapsed groups collapsed.

On fiddeling around I also noticed that setting group_collapsed leads to an empty table.

To try out:

@Mottie
Copy link
Owner

Mottie commented Feb 25, 2014

Hi @terwarf!

Thanks for reporting the issue with the group_collapsed option, I'll have that fixed up in the next update.

It'll take a bit more work, but I'll try to include a save option as well.

@terwarf
Copy link
Author

terwarf commented Mar 10, 2014

Hi Mottie,

sadly i have to report that this still not works properly for me - maybe because I use more widgets? I've updated the fiddle to reflect more of what I'm doing with tablesorter:

http://jsfiddle.net/NtgFr/9/

  • added 'stickyHeaders'
  • added group_callback to modify the group name
  • added editcomplete-event

To test:

  1. Expand Group "10 - SOMEVALUE"
  2. Edit a value in column 0
  3. press enter...

Am I missing something?

Thank you again for this great plugin.

@Mottie
Copy link
Owner

Mottie commented Mar 10, 2014

The problem is that the group_saveGroups option uses the text from the .group-name element to save the collapsed groups. And the callback is changing it immediately after.

So, in this demo I added a span after the "group-name" element and everything works great.

group_callback : function(cell, rows, column, table) {
    if( cell.find(".group-name").text() !== '' ) {
        cell.find(".group-name").after( '<span class="group-name2"> - somevalue</span>' );
    }
}

Please leave this issue open, so it will remind me to do the saving of group names after the callback. :P

@Mottie Mottie reopened this Mar 10, 2014
@terwarf
Copy link
Author

terwarf commented Mar 12, 2014

Thanks a lot, working perfectly for me now. Thumbs up.

@Mottie Mottie closed this as completed in 502130d Apr 10, 2014
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