Page 1 of 1

RecordsPerPage = $pagenumber

Posted: 2021-12-23 10:08
by sacgtdev
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.

Re: RecordsPerPage = $pagenumber

Posted: 2021-12-23 20:35
by pbottcher
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

Re: RecordsPerPage = $pagenumber

Posted: 2021-12-24 06:42
by sacgtdev
thanks. It works.