Stupid-Table-Plugin
Stupid-Table-Plugin copied to clipboard
Next row doesn't have columns, so I get a "b is undefined" error. Can I sort on every other row?
I have a table that looks something like:
<table>
<thead>
<tr>
<th data-sort="string">id</th>
<th data-sort="string">col1</th>
<th data-sort="string">col2</th>
</tr>
</thead>
<tbody>
<tr>
<td>1234</td>
<td>blah</td>
<td>foobar</td>
</tr>
<tr>
<td colspan="3">Summary here.</td>
</tr>
<tr>
<td>1235</td>
<td>heh</td>
<td>barfoo</td>
</tr>
<tr>
<td colspan="3">Another summary here.</td>
</tr>
</tbody>
</table>
When I click on a header, I get:
TypeError: b is undefined
I'm guessing that's because the next row is only the summary. There is no column to pull data from.
A) Is there a way to sort the two rows together?
B) Is there a way to skip the summary row so that the rows sort, even if it puts the summary row out of order? (I can move them back into place using the aftertablesort event.)
C) Is there a better way of organizing my data so that I would get the same effect? (Summary data is long, so it can't just live in it's own column without looking terrible.)