Skip to main content
gautams4173
December 13, 2022
Question

Pagination

  • December 13, 2022
  • 7 replies
  • 0 views

Hi,

I am trying to make an interface wherein I have a read only grid that displays data from a table stored in the database. Now I wrote an expression rule to fetch the data and passed it in the data parameter of the read only grid.

I want to implement pagination so that only 10 records initially are shown, clicking on the side arrow button '>' will load the next 10 records i.e. I will be running the query again and again for every 10 records changing my startIndex and batchSize. this will ensure that the query will not fail if the data is huge.

I wanted help in implementing the pagination as I tried implementing a few things and it didn't work. I'll attach what I have implemented.

PS : The pageSize parameter will not work, as the requirement is to "not use" pageSize. 

 

This is the expression rule where increment tells the batchSize, and times lets me tell the startIndex

This is the interface code

7 replies

stefanhelzle0001
Brainy
December 13, 2022

You have a requirement to not use pageSize !?!?! What kind of requirement is that???

I think the problem is that you only pass the list of items to the grid. To make paging work, it needs a full datasubset. Did you try this?

gautams4173
December 13, 2022

The requirement was given I guess so that we find alternatives of page size,a

Now about the datasubset, I might sound amateur, but wouldn't it put us in the same problem of putting load on the query ? Like I wanted only 10 records at a time  

stefanhelzle0001
Brainy
December 13, 2022

Is this a test or a training?

I do not understand your question about the datasubset. The gridfield will manage paging based on the additional values in the datasubset. When you only pass the data part of it, this will not work.

I missed one important thing? In the initial post you write "it didn't work". What exactly did not work?

mikes0011
Brainy
December 13, 2022

FWIW while you're using an external query and an external PagingInfo that you've pre-defined, you never need the read-only grid's internal "page size" parameter.  That's only needed when you're having it handle the query internally.

The Expression Guru