WHERE ?
WHERE ?
I am currently working on customizing APPGINI applications.
I am starting (with the help of forum members) to understand the why of the HOOKS folder, I can now customize the email sendings.
But I still block on the display of fields.
Let me explain: I would like to add a data NUMBER OF VISITORS at the end of the DETAil field in the table, but where can this be done? see my screenshot...
Re: WHERE ?
What about a new column configured as calculated field using SQL for getting the information from the database.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + 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 25.10 + all AppGini Helper tools
Re: WHERE ?
Hi,
if you want to "learn" the hooks capabilities, here another option that you may try.
In the hook/TABLENAME.php -> _init function you have the $options object that gives you a lot of capabilities for manipulating the way appgini will handle the different settings/parts.
Within the QueryFieldsTV array you will find the fields that are displayed in the TV and how they are build. See https://bigprof.com/appgini/help/advanc ... ist-object
So in your case you can try to adopt the display of the titre field like this:
Replace the TABLENAME, FIELDNAME and YOUR_SELECT_STATEMENT with your appropriate data. You may need to adjust the
YOUR_SELECT_STATEMENT where t.LOOKUPFIELD='.$options->PrimaryKey.'
if you have a more complex statement with additional WHERE clause parameters.
This is basically similar to the calculated field approach, but does not create a new field.
if you want to "learn" the hooks capabilities, here another option that you may try.
In the hook/TABLENAME.php -> _init function you have the $options object that gives you a lot of capabilities for manipulating the way appgini will handle the different settings/parts.
Within the QueryFieldsTV array you will find the fields that are displayed in the TV and how they are build. See https://bigprof.com/appgini/help/advanc ... ist-object
So in your case you can try to adopt the display of the titre field like this:
Code: Select all
$ar=array_flip($options->QueryFieldsTV);
$ar['FIELDNAME']='concat(`TABLENAME`.`FIELDNAME`," (",(YOUR_SELECT_STATEMENT where t.LOOKUPFIELD='.$options->PrimaryKey.'),")")';
$options->QueryFieldsTV=array_flip($ar);
YOUR_SELECT_STATEMENT where t.LOOKUPFIELD='.$options->PrimaryKey.'
if you have a more complex statement with additional WHERE clause parameters.
This is basically similar to the calculated field approach, but does not create a new field.
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.