DisplayTag
  1. DisplayTag
  2. DISPL-18

Setting own comparator for column sorting

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0 RC1
    • Fix Version/s: 1.1
    • Component/s: Paging/Sorting
    • Labels:
      None

      Description

      ====
      imported from sf tracker
      id 1020990
      submitted by Diego Werba Montiel - dwerbam
      http://sourceforge.net/tracker/index.php?func=detail&group_id=73068&atid=536613&aid=1020990
      ====

      I made some changes to rc1 to solve the problem for
      sorting (how to compare row values).

      Adding a "comparator" attribute to display:column you
      can specify the full classname that will solve how to
      order the rows.

      I don't know if it is the "best" way to resolve the
      problem but it works.

      You can check the solution in the attached patch file or
      even rewrite rc1 sources with it and execute maven.

      Seeya
      1. cvspatch
        12 kB
        fabrizio giustina
      2. displaytag-1.0-rc1-patch-comparator.tgz
        19 kB
        fabrizio giustina

        Activity

        Hide
        fabrizio giustina added a comment -
        patch
        Show
        fabrizio giustina added a comment - patch
        Hide
        fabrizio giustina added a comment -
        addictional patch from http://sourceforge.net/tracker/index.php?func=detail&aid=973874&group_id=73068&atid=536616

        ===

        Dejan Krsmanovic - dejank

        It would be nice if column tag could contain attribute
        for specifying Comparator class that should be used for
        sorting. That way, comparing String could be case
        insensitive and sorting Dates would be easer and
        sorting could be possible for non-English languages...
        Show
        fabrizio giustina added a comment - addictional patch from http://sourceforge.net/tracker/index.php?func=detail&aid=973874&group_id=73068&atid=536616 === Dejan Krsmanovic - dejank It would be nice if column tag could contain attribute for specifying Comparator class that should be used for sorting. That way, comparing String could be case insensitive and sorting Dates would be easer and sorting could be possible for non-English languages...
        Hide
        andy pruitt added a comment -
        Fixed for 1.1 - added comparator attribute to column
        Show
        andy pruitt added a comment - Fixed for 1.1 - added comparator attribute to column

          People

          • Reporter:
            fabrizio giustina
          • Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: