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

    Duplicate rows in ListGrid with paging

    we found that ListGrid with datasource which have primaryKey still CAN show duplicate rows. It's clear in documentation that primaryKey is used only for update and delete NOT for fetch operation. However when we fetch page1 with rows 1:40 and user stay with this result 2 minutes. In meantime on server new records are inserted and when ListGrid fetch next page 40:80, first rows of second page are same as last records of previous page (overlap). That's not what we expect. Can we set some property which will restrict ListGrid from showing duplicate (primaryKey) records? Or we have to override DataArrived method?



    To do it perfectly you will need a server-side way of tracking a version number of similar for the table, then send this to the client and have the client incorporate it in all requests, so the server can check it. When the client's version is stale, send back a response with invalidateCache set.


      Good hint, thanks. I will try it.


        I guess it's working different way than expected. If I have to continue from my first post. When I'm sending second page and I decide in server code that result set on client is wrong I have to send back whole 1:80 lines with invalidateCache?
        I'm trying to send back only 40-80 records with 'invalidateCache' however first page isn't request again when I scroll back. Am I doing something wrong?


          Make sure your startRow/endRow in your DSResponse reflect the row range you are returning. If you had startRow 0 in your response it would cause the effect you're seeing.

          If you think it's already correct, please post the response as shown in the RPC tab in the Developer Console.