How to fetch only 10 rows per page?

In an interface we are showing grid with 4 columns and data is populated in it through query entity. So in query entity we are fetching all rows matching the search criteria with "local!paginginfo: a!pagingInfo(startIndex:1, batchSize: -1)". We are storing this query entity output in a cdt and using "ri!cdt.column name" to populate data in grid. But In Grid if we use "local!paginginfo: a!pagingInfo(startIndex:1, batchSize: 10)", to show 10 records per page, it is not returning data at all and if use "local!paginginfo: a!pagingInfo(startIndex:1, batchSize: length(ri!cdt.id))", it is returning all rows at a time. Please suggest how to fetch only 10 rows per page

OriginalPostID-200029

OriginalPostID-200029

  Discussion posts and replies are publicly visible

Parents
  • @divyav As per my understanding of the question, here goes the pseudocode of how you can sort the paging issue you have been experiencing:

    load(
    \tlocal!arrayOfCDTData:,
    \tlocal!pagingInfo:a!pagingInfo(startIndex:1,batchSize: 10),
    \twith(
    \ tlocal!datasubset: fn!todatasubset(local!arrayOfCDTData,local!pagingInfo),
    \ ta!gridField(
    \ t totalCount: local!datasubset.totalCount,
    \ t columns: {
    \ ta!gridTextColumn(
    \ t label: "",
    \ t data: index(local!datasubset.data,"",{}),
    \ t alignment: "LEFT"
    \ t),
    \ t
    \ t },
    \ t value: local!pagingInfo,
    \ t saveInto: local!pagingInfo
    \ t)
    \t)
    )

    If the issue isn't resolved, I would suggest you attaching the code snippet of what you have written so far and the practitioners here can guide you accordingly by revising it.
Reply
  • @divyav As per my understanding of the question, here goes the pseudocode of how you can sort the paging issue you have been experiencing:

    load(
    \tlocal!arrayOfCDTData:,
    \tlocal!pagingInfo:a!pagingInfo(startIndex:1,batchSize: 10),
    \twith(
    \ tlocal!datasubset: fn!todatasubset(local!arrayOfCDTData,local!pagingInfo),
    \ ta!gridField(
    \ t totalCount: local!datasubset.totalCount,
    \ t columns: {
    \ ta!gridTextColumn(
    \ t label: "",
    \ t data: index(local!datasubset.data,"",{}),
    \ t alignment: "LEFT"
    \ t),
    \ t
    \ t },
    \ t value: local!pagingInfo,
    \ t saveInto: local!pagingInfo
    \ t)
    \t)
    )

    If the issue isn't resolved, I would suggest you attaching the code snippet of what you have written so far and the practitioners here can guide you accordingly by revising it.
Children
No Data