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

Fix sorting when the table has multiple rows of th's #68

Closed

Conversation

tyler-smith
Copy link

Fixes #67

@@ -84,7 +84,7 @@
var th_index = 0;
var dir = $.fn.stupidtable.dir;

$table.find("th").slice(0, $this.index()).each(function() {
$this.parents("tr").find("th").slice(0, $this.index()).each(function() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue seems to be that we're getting all th's. So if there is 1 th on the row above sortable th's, the columns will try to sort based on the column data before it. If there are 2, it'd try 2 before, etc.

@ryanmac
Copy link

ryanmac commented Nov 12, 2013

This worked flawlessly for sorting, but doesn't work with callbacks. For example, the sorting classes (sorting-desc, sorting-asc) don't work. Can you recommend a fix?

@joequery joequery closed this in 8267883 Aug 3, 2014
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

Successfully merging this pull request may close these issues.

When there are multiple rows of th's, it sorts based on the incorrect column
2 participants