Announcement

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

    Scrolled listgrid paging mechanism

    Hi smartclient team,

    We have a list grid hooked to a custom server data source (we have our own backend server handling sorting and filtering; local sorting and filtering is disabled). When the data is very dynamic (lots of changes) we see that when scrolling the list grid there are cases where sorting is not respected. Consider the following case:

    1. View the list grid sorted by data creation timestamp. When the list is first viewed, a request is made with paging parameters (start row = 0 end row = 80).
    2. Create a bunch of new data points (hence they should be the latest and at the top of the list)
    3. Scroll down the list grid. As I scroll I get a fetch (start row = 80 end row = 160). This fetch contains some of new data points that were just created.
    4. Now if I scroll back up, I will see the data that was fetched in step 1. (there is no new fetch happening). Hence I end up with a list that's sorted by creation time stamp but the sorting does not seem correct - see the attached image for example (newer data points are not above the older ones).

    Click image for larger version

Name:	faulty_sorting.png
Views:	78
Size:	40.1 KB
ID:	231073


    My question is: Is there any documentation describing the mechanism behind scroll based paging ?

    We would probably need to have local sorting mirror the backend/server side sorting to somehow detect that data on the client is incorrectly sorted ?


    Version: SmartClient Version: v9.1p_2015-03-26/Pro Development Only (built 2015-03-26)[/COLOR][/SIZE][/FONT]

    Thanks
    Last edited by alu; 9 Sep 2015, 13:03.

    #2
    We're not following - you've said you disabled client-side sorting. But you are now claiming that client-side sorting is not using the order you expected.

    Which is it?

    As far as the paging mechanism, see the ResultSet class doc and be sure to follow links to more specific reference.

    Comment


      #3
      Actually, here's your possible confusion: if you've disabled client-side sorting, we're not doing any sorting. What you're seeing is simply the result of what you returned for the initial fetch, plus what you've returned for the fetch that was triggered by scrolling, placed at the exact startRow/endRow indices you indicated in your DSResponse. Because you inserted points, this would naturally result in a scrambled sort, without any need to explain this in terms of the client-side logic reordering things.

      What you probably want to do is set the invalidateCache flag on your DSResponse if new points have been added. Otherwise, it's not just scrambled sorts you'll see - various patterns of scrolling would mean that some data records are never loaded at all, or load twice (if you don't immediately see this, run through some scenarios on a sheet of paper or similar).

      Comment

      Working...
      X