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

Sort indicator with multiple tables on a page #13

Open
antanova opened this issue Aug 15, 2016 · 3 comments
Open

Sort indicator with multiple tables on a page #13

antanova opened this issue Aug 15, 2016 · 3 comments

Comments

@antanova
Copy link

If I have multiple tables on a page, I get inconsistent behaviour from the sort order indicator (id sorttable_sortfwdind or sorttable_sortrevind). Sometimes the indicator moves from one table to the one I'm sorting, sometimes not.

I'd like the indicator to just remain in its original table, showing the last column I've sorted, as happens when the table is on its own on the page. It's probably a result of using ids on that element. Do you have any work-around for that?

Thanks.

@stuartlangridge
Copy link
Owner

I don't, at the moment -- it's basically that sorttable.js doesn't take into consideration that there might be more than one table, and so references the sort indicator by ID. This is a bug, and it needs fixing, and will be fixed as part of v3.

@antanova
Copy link
Author

Ah, thanks. If I manage to get enough time to fix it, I'll post the fix back here.

@brettwarthen
Copy link

FYI...here's an easy fix...

Add this CSS to generate the indicators:

.sorttable_sorted::after {
content: "\25BE";
}
.sorttable_sorted_reverse::after {
content: "\25B4";
}

Remove every line of JS that includes either of the following (including as a variable name or as part of an element id):

sortfwdind
sortrevind

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

3 participants