[sailwave] sortable html table results

isn’t it possible to use Jquery tor implement sorting on your table. See http://stackoverflow.com/questions/17192669/html-table-sorting-in-jquery

···

Mvh. Karsten Svenningsen

2014-05-20 12:09 GMT+02:00 Scott Rickard rickard23@yahoo.com [sailwave] sailwave@yahoogroups.com:

Hi,

I wish to output the results in a sortable table so that one can simple click the column heading when viewing the results and the results table will sort by that column’s entries.

This requires three changes to the configuration, two of which I can do - but one I cannot figure out how to do.

Step one: add this .js file http://www.kryogenix.org/code/browser/sorttable/sorttable.js to the web folder where the results will uploaded.

Step two: add the below line to the Sailwave/Templatesheader.txt file between in the “” and “” lines.

Step three: Change the html results file so that the line which has
<table class=“summary table” …
is changed to read (and yes, just one “t” in sortable)

<table class="summarytable sortable" ....

And then the published results should be sortable by clicking on the column heading.

Some notes:

Alternatively, you can add the js file to the sailwave javascript folder and, then, when publishing results, select the “Effect” sorttable (and yes, that’s two "t"s in sorttable). In this case - you can skip step 1 and 2 above (as the javascript will be included in the results html file). One thing I noticed is that there is a comment at the beginning of the js file which has a " in it which can cause problems - if you just remove the lines with the "'s in them from the comment in the top of the js file (lines 9 and 10), everything works fine. If you don’t, the " can be interpreted as the end of the comment and you’ll see some garbage at the top of the results html file when viewing in a browser. This is not a problem is you do the three steps above.

So my question is, is there a way of getting sailwave to output

<table class="summarytable sortable" .... instead of <table class="summary table" ... when outputing results to the web?

And then, as a follow-on question - if you do the above, and you sort the results by something other than the rank when viewing them, and you want to view then in place order again, then you have to reload the page as the sorting sorts in dictionary order 10th,11th, … 19th, 1st, 2nd, … instead of understanding that these are number and 1st should come before 10th - so my question is, how do you change the output format for the Rank so that it is 1, 2, 3 and not 1st, 2nd 3rd?

Thanks,

-scott

Yes, tablesorter would be another option - but - you would still need to add tablesorter as a class to the table and, in this case, the table would have to include the thead and tbody tags. The issue is that I do not know how to edit the fields in the table html code in an automated fashion from within sailwave.

Edit the DOM using javascript.

···

Cheers,

Colin J

http://sailwave.com

On Tue, May 20, 2014 at 3:02 PM, rickard23@yahoo.com [sailwave] sailwave@yahoogroups.com wrote:

Yes, tablesorter would be another option - but - you would still need to add tablesorter as a class to the table and, in this case, the table would have to include the thead and tbody tags. The issue is that I do not know how to edit the fields in the table html code in an automated fashion from within sailwave.