Monday, 15 July 2013

Footable sorting with colspan rows -



Footable sorting with colspan rows -

i have sorting issue when using rows colspans when sorting footable table.

my table structure:

class="snippet-code-html lang-html prettyprint-override"><table class="table footable"> <thead> <tr> <th>name</th> <th data-type="numeric">date of birth</th> <th>country</th> </tr> <thead> <tbody> <tr> <td>bill smith</td> <td data-value="315532800">1/1/1980</td> <td>england</td> </tr> <tr> <td colspan="3">some long description of bill<td> </tr> <!-- many, many other rows --> </tbody> </table>

i have checkbox toggle colspan rows on/off, if they're displayed , sort column, colspan rows grouped together.

jsfiddle demo

is there way sort correctly places colspan (description) row beneath right info row?

so root of problem description row separate row , not "linked" info row above it. way user know info row description row belongs order of rows. 1 time sort table, order changes , can no longer count on order link info , description rows. (wow that's kind of hard read. apologies in advance...)

so, 1 way solve have info , description rows both contained in same row.

<table> <thead> <tr> <th>name</th> <th data-type="numeric">date of birth</th> <th>country</th> </tr> </thead> <tbody> <tr> <td> <table> <tr> <td>bill smith</td> <td data-value="315532800">1/1/1980</td> <td>england</td> </tr> <tr> <td colspan="3">some long description of bill</td> </tr> </table> </td> </tr> <tr> <td> <table> <tr> <td>john smith</td> <td data-value="315532800">1/1/1980</td> <td>france</td> </tr> <tr> <td colspan="3">some long description of john</td> </tr> </table> </td> </tr> </tbody> </table>

here's plunk shows in action: http://plnkr.co/edit/nvmugzvaaix1x7wugysm

footable

No comments:

Post a Comment