Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow no thead #2

merged 3 commits into from Oct 3, 2012


None yet
2 participants

jasonrhodes commented Oct 3, 2012

Made changes to how jQuery finds and populates the <th> elements and their click events, and how it finds and populates the <tbody> rows.

You can just search for <th> elements without looking inside of a <thead> element, to make them clickable. Then, if the this.$thead stored variable's length is 0, the rows variable can fallback to all <tr> elements that contain a <td> element (rather than a <th>).

This should keep the current functionality in tact while falling back for people whose table markup is slightly out of their control and thus can't use <thead>.

jasonrhodes added some commits Oct 3, 2012

Added a check to allow for the markup to not include a thead and tbod…
…y, if there is no thead then it tries to populate the rows variable with a collection of all tr elements that contain a td element

kylefox commented Oct 3, 2012

Looks great, thanks for the patch! Would you mind updating the README?


jasonrhodes commented Oct 3, 2012

Sure. I'll push them when they're ready.


jasonrhodes commented Oct 3, 2012

All done. I also have another small change that should allow the sort to accurately sort numbers, but I'll wait until this one gets pulled in to avoid Pull Request confusion. ;)

kylefox added a commit that referenced this pull request Oct 3, 2012

@kylefox kylefox merged commit 818e8be into kylefox:master Oct 3, 2012

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