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.
You can use the manual paging option in the grid field configuration.Refer the tutorial given in (Manual paging section)- docs.appian.com/.../read-only-grid-configuration.html
Basically, create a local!pagingInfo with start Index 1 and batch size of 25. In the load section write a query entity to query first 25 records and display them in the grid. Use the pagingSaveInto in the a!gridField to save the updated local!pagingInfo and then re-query next datasubset based on this pagingInfo
I would reconsider the design as paging through 100,000 rows with a page size of 25 would require 4,000 pages, which probably won't be a good user experience. You might want to consider adding some sort of searching or filtering functionality if you have to be able to display this data in Appian (or find an alternative design to meet your requirement).
Manual paging shouldn't be necessary in this case - the standard method of adding the query to the data parameter and using fv!pagingInfo should allow you to query 25 items at a time.
Here's an example:
label: "Read-only Grid",
label: "First Name",
label: "Last Name",
label: "Start Date",
dannyh0001 said: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.
Discussion posts and replies are publicly visible
© 2019 Appian. All rights reserved.