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

Next row doesn't have columns, so I get a "b is undefined" error. Can I sort on every other row? #194

Open
jerrac opened this issue Mar 5, 2018 · 0 comments

Comments

@jerrac
Copy link

jerrac commented Mar 5, 2018

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.)

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

1 participant