Page 1 of 1

Records per page

Posted: 2020-11-27 09:04
by jlarmarange
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

Re: Records per page

Posted: 2020-11-27 13:50
by D Oliveira
Image

tablename_view.php, look for:

Code: Select all

$x->RecordsPerPage = 25;

Re: Records per page

Posted: 2020-11-27 16:38
by pbottcher
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.

Re: Records per page

Posted: 2020-12-09 13:41
by onoehring
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