Records per page

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
jlarmarange
Posts: 16
Joined: 2019-02-21 19:03

Records per page

Post by jlarmarange » 2020-11-27 09:04

Would it be possible to define the number of records per page directly in AppGini?

Currently, it could be modified in "parent-children.php" but it would be nice to not have to rechange it each time the app is generated with AppGini.

Best regards

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: Records per page

Post by D Oliveira » 2020-11-27 13:50

Image

tablename_view.php, look for:

Code: Select all

$x->RecordsPerPage = 25;

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

Re: Records per page

Post by pbottcher » 2020-11-27 16:38

Unfortunately you still have to change it in the parent-children.php. There is no option like for the tableview (as shown above) for the child view's.
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.

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Records per page

Post by onoehring » 2020-12-09 13:41

Hi,

actually it might be easier. Let's think about it for a second. pbötcher mentioned parent-children.php and this we can utilize:
Peeking at parent-children.php you will find a php variable that contains all settings:

Code: Select all

$pcConfig = array(
			'parenttablename' => array(
				'someFieldName' => array(
					'parent-table' => 'ecomo_location',
					'parent-primary-key' => 'ID_Lo',
					'child-primary-key' => 'ID_Co',
					'child-primary-key-index' => 0,
					...
					'records-per-page' => 10,
					'default-sort-by' => false,
					...
				),
Aha - it's all in a variable! So, why not try this:
Define a new table where you allow setting the number of records for parenttable -> childtable. Then, when parenttable is being opened, use the /hooks/tablename.php -> _init function to read your user defined value and write that value into the variable.
Well, you might need to try where exactly the parent-children.php is read, but I suppose it's read once and used again and again.

This way actually each user could set his own desired records-per-page.

Just an idea.
Olaf

Post Reply