X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yarrg%2Fweb%2Ftabsort;fp=yarrg%2Fweb%2Ftabsort;h=444bfb56b15f6e1b01e6e2ff74a29c1140209bb8;hp=db7ac2b48cdd5468e5ccab0fe553719e18c23a38;hb=c20deee42fbd2d86e976bb6a2e4f8e5f5cf2631b;hpb=ee80b1ab92305277d07d99faea8682aea690b59a diff --git a/yarrg/web/tabsort b/yarrg/web/tabsort index db7ac2b..444bfb5 100644 --- a/yarrg/web/tabsort +++ b/yarrg/web/tabsort @@ -40,6 +40,7 @@ $table => 'ts_table' $sortkeys => 'ts_sortkeys' $throw => undef $tbrow => undef +$rowclass => undef $cols @@ -90,6 +91,14 @@ function <% $sortfn %>(compar) { debug('final row '+rowix+' [[ '+row+' ]]'); } newrows.sort(compar); +% if (defined $rowclass) { + for (var rowix=0; rowix < newrows.length; rowix++) { + var row= newrows[rowix]; + var classname= '<% $rowclass %>'+(rowix % 2); + debug('fix row '+rowix+' class '+classname); + row.className= classname; + } +% } newrows= newrows.concat(finalrows); for (var rowix=0; rowix < newrows.length; rowix++) { var row= newrows[rowix];