Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-266

Sort call to model not receiving the right parameters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.8
    • 5.0.7
    • None
    • None

      original thread
      https://sourceforge.net/tracker/?func=detail&aid=3344647&group_id=152762&atid=785191

      We have a Grid that has a ListModelExt attached. We have implemented/overridden the method: sort(Comparator c, boolean ascending)
      The columns of our grid has custom Ascending and Descending comparators.

      When a user clicks on a column (not using the column-context menu) everything works fine.
      The first click calls sort(ASC_comparator, true),
      and the next calls sort(DESC_comparator, false), and so on

      However, if the user uses the column context-menu and chooses "Sort Descending", the call to the ListModelExt receives the Ascending sort comparator, instead of the Descending one.

      I discovered that this only happens if the column's sort-direction is "natural". If the column sort-direction has been explicitly set to "ascending" (even though not ever sorted), then it passes in the Descending Comparator

            SimonPai SimonPai
            benbai benbai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: