RecordsPerPage = $pagenumber

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
sacgtdev
Veteran Member
Posts: 75
Joined: 2020-06-10 11:14

RecordsPerPage = $pagenumber

Post by sacgtdev » 2021-12-23 10:08

I would like to let user to choose the no. of record per page. Is there anyone can share the code?

I am thinking of leveraging $x->RecordsPerPage = $pagenumber; and create a table to let users to specify page number eg. 25 instead of hard-coded?

But, how to store that in the session when a user modify the value in the table? Please advise.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: RecordsPerPage = $pagenumber

Post by pbottcher » 2021-12-23 20:35

Hi,

I think you can modify the $option->RecordsPerPage value in the _init function.
So you can create a table where the user can enter eiher a global value or even an individual value per table for the RecordsPerPage.

In the _init hook you just need to check if there is an entry in the user table and update the $option->RecordsPerPage

Hope that gives a starting point
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

sacgtdev
Veteran Member
Posts: 75
Joined: 2020-06-10 11:14

Re: RecordsPerPage = $pagenumber

Post by sacgtdev » 2021-12-24 06:42

thanks. It works.

Post Reply