Over many years, I have found Matt Kruse's Table Sort to be a great solution for sorting and filtering tables, but my current requirement has me hiding/restoring columns dynamically (radio buttons, using javascript), and this seems to corrupt the Matt's table-structures that enable the sorting and filtering.
I have tried both rebuilding the table into .innerhtml, and also modifying the display style. (I have all the table information in arrays, so can rebuild the table if needed.) The table is built from the arrays initially, and Matt's library appears to be happy with that.
I have been going through Matt's code to see how to cause them to re-initialise after I make the changes to the table, but I think the Matt is a couple of steps over my ability. I don't understand how Matt's library code links to the htlm tables.
Can anyone have a quick look at the library and tell me how I can prod them into reinitialising (without reloading the whole page) - http://www.javascripttoolbox.com/lib/table/source.php
I know this is REALLY old, but just in case, you can just reinvoke the table.js script as a function after your changes with something like:
That will cause it to run again and apply to any tables/cells with the applicable classes.