colspan and rowspan in thead causes unexpected behavior with most recent version
bchartoff opened this issue · comments
The example table here
http://mottie.github.io/tablesorter/docs/example-header-column-span.html
Does not behave as expected, using the current version, in a variety of buggy ways (e.g. clicking "First Group" sorts by "Index"). I encountered similar issues in my own table, which I was able to fix by using an older version (didn't test every version number, but currently using 2.22.0 which works almost perfectly)
While behavior is close to perfect, one oddity in a current table:
<thead>
<tr>
<th class = "series categories col0" rowspan="3">Year</th>
<th colspan="2" rowspan="2">Annual maximum taxable earnings (dollars)</th>
<th colspan="8">Contribution rate (percent)</th>
</tr>
<tr>
<th colspan="4">Employer and employee, each</th>
<th colspan="4">Self-employed person</th>
</tr>
<tr>
<th class = "series col1">OASDI</th>
<th class = "series col2">HI</th>
<th class = "series col3">OASDI</th>
<th class = "series col4">OASI</th>
<th class = "series col5">DI</th>
<th class = "series col6">HI</th>
<th class = "series col7">OASDI and HI</th>
<th class = "series col8">OASI</th>
<th class = "series col9">DI</th>
<th class = "series col10">HI</th>
</tr>
</thead>
Clicking the column with the text "Employer and employee, each"
incorrectly adds the tablesorter-headerAsc
to the parent header (one row up) with the text Contribution rate (percent)
, like so
Error persisted in, at least, versions 2.4 -> 2.22.0
Hi @bchartoff!
Thanks for reporting this issue! Yeah, I think this issue popped up when I tried to fix another issue with IE8 (#987). I'll try to get this fixed ASAP!
Thanks, @Mottie ! And thanks for the truly stupendous plugin. Yeah, IE ruins everything...
👍 fixed the buggy behavior, thanks so much!
However, The problem I outlined starting on row 8 of my comment above still persists. Should I open a separate issue? To demonstrate the problem more clearly, I made this fiddle
https://jsfiddle.net/bchartoff/sqyxtt1h/7/
It's a slight modification of the table in the demo. As you can see, clicking on First Group
toggles the tablesorter-headerAsc
and tablesorter-headerDesc
class on Sort non-index
Didn't use a cdn for tablesorter, pasted in the most recent minified code (from 91a76ea) but the same problem exists with all versions I tested.
Not as huge an issue for sure, but still unexpected functionality!
Oh, oops, I must have missed that before. I'll have a look. No need to open another issue.
Ok, everything should be all fixed now... hopefully it didn't break IE8 again LOL
Haha, thanks again, @Mottie This has been a pretty stupendous FOSS interaction. I'm just blown away by your speed, helpfulness, and familiarity with this codebase. I hope to contribute to the plugin sometime soon!
Just letting you know, I had to update the code again because that last change broke multisort indicators.