Announcement

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

    How to trigger a fetchMode paged call to the server

    It looks to me like in a ListGrid, the default fetchMode is paged, and in fact I'm seeing start=0 and end=75 on the server side. But when I scroll to the bottom of the Grid, it never makes the fetch data call to get rows 75 through 150 or whatever it determines is next. Do I need to do anything special to make this work? Does the server need to somehow communicate in it's response that these are rows 0 through 75 of 500 for example?

    #2
    Hi Peter,

    You can use the attribute DSResponse.totalRows to tell the client paging system how many total rows of data are available.
    DSResponse.startRow and DSResponse.endRow indicate where the data should show up in the data set, allowing the paging system to automatically slot them into the data that has already been loaded.

    Note: Requests are triggered by the client for the appropriate set of rows based on the UI - If you scroll through a grid, rows will automatically be requested for the currently visible viewport. Scrolling rapidly to the bottom of your list will request the last 'page' of results (it intelligently skips intervening rows that the user scrolls past rapidly.)
    The start/end row returned by a response doesn't have to match the requested set of rows - your server code can return an arbitrary set of rows provided it includes start / end row properties so the client knows where to slot these data into their cache.

    Comment


      #3
      Question about totalRows

      I've got paged fetch working, but there's something I'm seeing that doesn't make sense. When I return totalRows = 775 from the server with each fetch, I would expect the ListGrid would never ask for any rows beyond that. I'm seeing requests from the Grid for 800-900 for example when I scroll to the bottom. Am I doing something wrong?

      Comment


        #4
        Hi Pallen,

        From a quick look, running the DataBound fetch example from the SDK doesn't show an issue (you can see the inbound startRow and endRow in either the server or client-side log).

        Before you scroll to the bottom, if you check myGrid.data.getLength() (which means calling ResultSet.getLength()), what do you see? getLength() should match whatever you returned as totalRows when the dataset was first loaded.

        Comment

        Working...
        X