sorttable bug: pre-post-callbacks

If the user can specify a post-sort function or a pre-sort function then
they can fix almost all problems that sorttable can’t fix for them
(like, say, zebra striping, if we haven’t fixed
that first). Syntax might be awkward, though, since you may want
per-table pre- and post-sort functions, rather than per-page. Something
like this, perhaps:

@<script type=“text/javascript” src=“sorttable.js”>
<script type=“text/javascript”>

function my_post_sort_function(table_object) {
// table_object has just been sorted: do what you want with it
...
}

sorttable.postSortCallback = my_post_sort_function;
</script>@

and you have to take care of doing different things for different tables
yourself. This also gets around the issue that you can’t hand a table
object to sorttable on page load, because (a) you might be running in
the <head> before the DOM has been fully-formed and (b) you might load
the table into the page afterwards with Ajax. The above way means you
can make the determination at runtime.

Back to the sorttable bug list

Email me when this bug gets updated: · privacy · powered by ChangeDetection