Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    11.1p ListGrid sorts newly added row out of view and only afterwards removes sort indicator

    Hi Isomorphic,

    please see this sample (v11.1p_2018-01-09) and sort on population. Then add a row with population=100.

    This is what it looks like for me in Chromium 63 / FF57 Portable:
    Click image for larger version

Name:	Add with sort.gif
Views:	91
Size:	159.0 KB
ID:	251083
    See how the row is sorted to the top of the dataset (and out of view), before the sort indicators are removed.


    This is the same test, without sorting before adding:
    Click image for larger version

Name:	Add without sort.gif
Views:	101
Size:	73.5 KB
ID:	251082

    In my opinion, the latter behavior is the correct one w.r.t to this post of yours and the ResultSet.setUpdatePartialCache() docs.

    This is not an important one for me, I just noticed it testing another case.

    Best regards
    Blama

    #2
    This should be fixed back to SGWT 4.1p/SC 9.1p in nightly builds dated 2018-01-12 and beyond.

    Comment


      #3
      Hi Isomorphic,

      good timing, I was just searching for this thread, as I have another question here.
      First, I can see that the issue is fixed in v11.1p_2018-01-14. Using the same sample in SmartClient now.

      When sorting the ListGrid by population, this is shown (as expected) in the Developer Console Log tab for getSort():
      Code:
      Evaluator: result of 'countryList.getSort()' (1ms):
      [Obj
      ]
      After adding a new row, this is shown for the same command:
      Code:
      Evaluator: result of 'countryList.getSort()' (0ms):
      [
      ]
      I'm not sure this is in sync with this post of yours (the one linked above):
      The fact that the grid unsorts after a record is updated or added is intentional, and is part of a behavior to try to keep records in the viewport if the user just modified them - see ResultSet.updatePartialCache.

      This doesn't drop the sort specifiers, it just stops applying them temporarily. Calling resort() re-applies them.
      Also, and this is how I came to wonder, calling resort() does in fact not resort and displays this in the console:
      Code:
      Evaluator: result of 'countryList.resort()' (0ms):
      true
      Is this all expected? Also, I did not find a method like "needsResort()" in the docs. Isn't that one needed?

      Best regards
      Blama

      Comment


        #4
        Sorry, we misspoke - updating a record such that unsorting occurs in an fact permanent. If you wanted to restore the previous sort direction at some point, you would need to preserve it yourself and re-apply it.

        This also explains the absence of a "needsResort()" API.

        Comment


          #5
          Hi Isomorphic,

          ahh, thank you. That explains it.
          Could you add some hint on this on ResultSet.setUpdatePartialCache() (does cover it a bit, but does not say sort is removed) or ListGrid.setSort()? Best is most likely add it to setUpdatePartialCache() and link it from setSort().
          Now that I and others stumbled upon it more than once, it might really be worth it.

          Best regards
          Blama

          Comment

          Working...
          X