Rowspan Supported Table Sorting with Prototype
When I was working with tablesort, I realized that it doesn't support sorting cells with rowspan. And really, fewer table sorting javascript lib support this feature. It's known that table with rowspan attribute is a really messed up structure. It drove my crazy at the first time when I am writing a script to generate this kind of table.
But it would be very cool to support js sorting on rowspan cells! So I patched tablesort to support it. The idea is simple:
1) get rows that either with rowspan cell(s) or wihout rowspan cell at all and not after row with rowspan cell(s);
2) attached SUB-ROWS to row with rowspan cell(s);
3) sort rows get from step 1);
4) append rows get from step 1) to the table; and for each one, append the SUB-ROWS attached to it after.
One small issue left is that since we only sort rows get from step 1), we lose the sorting ability on SUB-ROWS. But I think that would be too difficult to support, and from my project, we happened not want to sort those SUB-ROWS, so I leave it for future. :)
Check the project out on my github. There is also a full demo available.
