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

Can sorttable ignore "unfolded" rows? #33

Open
Vemb opened this issue Mar 31, 2022 · 0 comments
Open

Can sorttable ignore "unfolded" rows? #33

Vemb opened this issue Mar 31, 2022 · 0 comments

Comments

@Vemb
Copy link

Vemb commented Mar 31, 2022

Great script that is working well for me after a little debugging. But ultimately it seems it won't do what I need it to: To ignore "child rows" and only sort parents.

What I mean is that I have a table with X rows. Each row has a hidden row underneath it that can be "expanded" or "unfolded". Parent and child have separate classes, i.e.:

<tr class="parent">, <tr class="child">, <tr class="parent">, <tr class="child">
etc. etc.

The parent has 6 sortable columns. When the row is clicked, a child with some text etc. is exposed beneath it, and this child row should not be part of any sorting but always just be "glued" to its parent. An example here: https://nimb.ws/bgT67M (screenshot)

But as soon as the table is sorted with Sorttable, the functionality of the unfolded rows is broken.

The JS code used to expand the parent rows is this: https://codepen.io/jopico/pen/kyRprJ

I've tried but I can't get my head around it. I can't get Sorttable to ignore the child rows when sorting.

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

No branches or pull requests

1 participant