RecordsPerPage for child table
RecordsPerPage for child table
Dear all,
the way(s) how to modify the number of "records per page" for a "PARENT-table" is clear for me in AppGini 5.60:
1. Open the axp file > click on your table and modify the field "Records per page" from default value 10 to X
or
2. Go to datalist.php > find "function DataList()" > modify the line $this->RecordsPerPage = 10;
BUT: I would like to modify the number of "Records per Page" for a "CHILD table" below the parent table.
Unfortunately I could not find any php file where to modify this default value from 10 to X??
Any idea / hint for me?
KR
Yilmaz
the way(s) how to modify the number of "records per page" for a "PARENT-table" is clear for me in AppGini 5.60:
1. Open the axp file > click on your table and modify the field "Records per page" from default value 10 to X
or
2. Go to datalist.php > find "function DataList()" > modify the line $this->RecordsPerPage = 10;
BUT: I would like to modify the number of "Records per Page" for a "CHILD table" below the parent table.
Unfortunately I could not find any php file where to modify this default value from 10 to X??
Any idea / hint for me?
KR
Yilmaz
Re: RecordsPerPage for child table
Dear all,
anyone an idea or hint for me??
KR
Yilmaz
anyone an idea or hint for me??
KR
Yilmaz
Re: RecordsPerPage for child table
You can do this by editing the generated "parent-children..php" file .. Look for lines containing "records-per-page" and change the value in there.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
- Need personalized consulting on your specific app and customizations? Book an online call with me here.
Re: RecordsPerPage for child table
Hi, is there also an idea to do this via a hook?
Many thanks.
Many thanks.
Re: RecordsPerPage for child table
Hi,
there is currently no option to do this via a hook. You need either to change the orginial parent-children.php, or write your own logic to handle the modification.
there is currently no option to do this via a hook. You need either to change the orginial parent-children.php, or write your own logic to handle the modification.
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.
Re: RecordsPerPage for child table
OK. thank you very much!
Re: RecordsPerPage for child table
I am using AppGini version 23.17 revision 1557.
In the past versions of AppGini, I have been able to change the number of child records per page by editing the "parent-children.php" file. Now when I open that file there is a message saying /* Parent/children config array has moved to incCommon.php#getLookupFields() */. I cannot find where to make the change in the "incCommon.php" file.
Can someone help me?
Ray
In the past versions of AppGini, I have been able to change the number of child records per page by editing the "parent-children.php" file. Now when I open that file there is a message saying /* Parent/children config array has moved to incCommon.php#getLookupFields() */. I cannot find where to make the change in the "incCommon.php" file.
Can someone help me?
Ray
Re: RecordsPerPage for child table
As a starting point:
Check out hooks/_global.php. there is a new hook function for a while now for configuring a lot of stuff (almost everything I think) related to child-tables.
Check out hooks/_global.php. there is a new hook function for a while now for configuring a lot of stuff (almost everything I think) related to child-tables.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.14 Revision 1665 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.14 Revision 1665 + all AppGini Helper tools
Re: RecordsPerPage for child table
Hi Jan,
When I open the _global.php hooks file, I don't find any reference to child records:
When I open the _global.php hooks file, I don't find any reference to child records:
Code: Select all
<?php
// For help on using hooks, please refer to https://bigprof.com/appgini/help/working-with-generated-web-database-application/hooks
function login_ok($memberInfo, &$args) {
return '';
}
function login_failed($attempt, &$args) {
}
function member_activity($memberInfo, $activity, &$args) {
switch($activity) {
case 'pending':
break;
case 'automatic':
break;
case 'profile':
break;
case 'password':
break;
}
}
Also, I don't know what I would put in there to modify the records-per-page of the subject table.
Thank you for helping!
Ray
function sendmail_handler(&$pm) {
}
Re: RecordsPerPage for child table
If function
Then open a detail view, having child records and see the output.
There is a
child_records_config
does not exist in hooks/__global.php
, add this:Code: Select all
function child_records_config($childTable, $childLookupField, &$config)
{
if (getLoggedAdmin()) {
$prop = function ($name, $value) {
echo "<dt>{$name}</dt><dd><pre>". print_r($value,true) ."</pre></dd>";
};
echo '<h3>Help for customizing child records</h3>';
echo '<dl>';
$prop('file', "hooks/__global.php");
$prop('function', 'child_records_config($childTable, $childLookupField, &$config)');
$prop('$childTable', $childTable);
$prop('$childLookupField', $childLookupField);
$prop('$config', $config);
echo '</dl>';
}
}
There is a
$config
-variable, passed by reference (&$config
) which you can modify according to your needs.Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.14 Revision 1665 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.14 Revision 1665 + all AppGini Helper tools
Re: RecordsPerPage for child table
Hi Jan,
I added the code you provided to the _global.php and viewed the output that appeared in the child tables. Now my question is how do I modify that output? Do I need to copy and paste it into the _global.php file? It is uneditable in the output on the screen.
I added the code you provided to the _global.php and viewed the output that appeared in the child tables. Now my question is how do I modify that output? Do I need to copy and paste it into the _global.php file? It is uneditable in the output on the screen.
Re: RecordsPerPage for child table
Hi,
the code above is just for showing the new hook-function
Using the code above, check the contents of
As I don't have too much time now, maybe someone else can jump in and elaborate a solution for your specific needs. If not, feel free to contact me by email ([email protected]) for further assistence.
the code above is just for showing the new hook-function
child_records_config
in hooks/__global.php
and the configuration variables $childTable
, $childLookupField
and especially &$config
which you can use for modifying many options. Using the code above, check the contents of
$config
and see if there are useful options for your specific needs. Then just keep the following code and change $config
according to our needs.Code: Select all
function child_records_config($childTable, $childLookupField, &$config)
{
// change $config variable according to your needs
}
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.14 Revision 1665 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.14 Revision 1665 + all AppGini Helper tools
Re: RecordsPerPage for child table
Hello,
I use the following code to control the number of children's RecordsPerPage to appear under the parent DV.
This code location is in hooks/__global.php
invoice_item : child table name
invoice_id : the field name of the lookup field which linking to the parent table
in my case, I specify 20 records per page.
This will only work for version 22.14 onwards.
I use the following code to control the number of children's RecordsPerPage to appear under the parent DV.
This code location is in hooks/__global.php
Code: Select all
function child_records_config($childTable, $childLookupField, &$config) {
$config['invoice_item']['invoice_id']['records-per-page'] = 20;
}
invoice_id : the field name of the lookup field which linking to the parent table
in my case, I specify 20 records per page.
This will only work for version 22.14 onwards.
Zala.
Appgini 24.17, MacOS 14.6 Windows 11 on Parallels.
Appgini 24.17, MacOS 14.6 Windows 11 on Parallels.
Re: RecordsPerPage for child table
Thank you! I will try this.