3 Replies Latest reply: Apr 8, 2009 10:43 AM by ATD RSS

    Sorting on columns with templated Report -- Named Column (row template)

      Hi forum,

      I'm trying to duplicate a regular report's column sorting functionality in a "Named Column" report.
      The column headers are in the "Before first and after last row text" "Before Rows" area of the template :
      <th onClick="sortByColumn('#REGION_ID#',5)">Frequency</th>
      invoking this javascript:
      function sortByColumn(regionId,colNo) {
           var u = "f?p=124:401:&SESSION.:fsp_sort_" + colNo + "::RP&fsp_region_id="+regionId.substring(1);
      I'd like to sort descending when a user clicks the column again, and to display the column sort arrows (up/down).
      However, since sorting is persisted per user, even when the page's cache is cleared, it would be necessary to pick up the sort column and order (ascending,descending) on page load or query it later using ajax, so that the sort display (the arrows) stays in synch with the actual sort.

      Has anyone got an idea how to do this?


      Edited by: YT on Apr 1, 2009 4:19 PM

      Edited by: YT on Apr 1, 2009 4:24 PM

      Edited by: YT on Apr 1, 2009 4:26 PM