How much to Query when displaying a few rows at a time in a read-only grid?

Suppose I have a database table 100,000 entries large, and I want to display them in a read-only grid 25 at a time.

How can I achieve this, without having to query everything at once?

It seems that if I query using the page size (here, 25) then the read-only grid does not have an arrow allowing you to move to the next page, presumably because it thinks it is displaying everything. However, since the read-only grid does not have a totalCount parameter, I am unsure of how I can tell the read-only grid that there are still more rows to be queried and displayed.

  Discussion posts and replies are publicly visible

Parents
  • Certified Lead Developer
    However, since the read-only grid does not have a totalCount parameter, I am unsure of how I can tell the read-only grid that there are still more rows to be queried and displayed.

    Just to be clear here, I believe you're misunderstanding how the [new style] read-only grid works. 

    It's correct that it doesn't have a "totalCount" parameter any more, but it's incorrect that this means that it doesn't account for this. 

    In the 19.2+ style grid, you would use the DATA parameter for this - at which point you would either pass in a valid query that returns a dataSubset, or a local variable storing a datasubset.  Both of these will contain a "totalCount" within the data subset, and the Grid component uses that in order to determine the current max size.  Note that your query will need to have "fetch total count" turned on.

Reply
  • Certified Lead Developer
    However, since the read-only grid does not have a totalCount parameter, I am unsure of how I can tell the read-only grid that there are still more rows to be queried and displayed.

    Just to be clear here, I believe you're misunderstanding how the [new style] read-only grid works. 

    It's correct that it doesn't have a "totalCount" parameter any more, but it's incorrect that this means that it doesn't account for this. 

    In the 19.2+ style grid, you would use the DATA parameter for this - at which point you would either pass in a valid query that returns a dataSubset, or a local variable storing a datasubset.  Both of these will contain a "totalCount" within the data subset, and the Grid component uses that in order to determine the current max size.  Note that your query will need to have "fetch total count" turned on.

Children
No Data