Pika Case List ~ Sortable Table Demo 02
I have adapted the same sorting script used in the earlier demo to mock up a functioning sortable Pika Case List table. This second demo provides a concrete example of how Brian McAllister’s tablesort script works with a few other table data types common to a Pika search-result list. In this case list demo you can see how the sorting works with a non-standard numeric value (“Case No.”), American date formats (“Opened” and “Closed”) and a non-sortable column (“Time”). Again, there was no need to touch the sorting script itself. By changing the names of class attributes in the markup, one can control how the script works.
For example, the first numeric column has been set to sort on the third sequence in the case number, rather than the first (needless to say, one can set it to sort by any of the three numerical sequences in the case number); the sorting of dates in an American format works smoothly, recognizing both one- and two-digit formats for the month and the day of month and two- or four-digit formats for the year; and the column on the far right with the clock icon illustrates how one can selectively set a column not to sort at all.
One final touch worth noting: the sorting script also recognizes custom class attributes for defining which column is actively sorted on loading the page, as well as the order of the values in that column. For example, in the case list demo the table tag has the class="sortable-onload-4-reverse attribute assigned, i.e., onload the script actively sorts the fourth column and lists the values in reverse order. Done.
(Yes, those are real names. No, they are not clients. All are family or friends of Webdogs 2.0. We count ourselves blessed as many times over.)

