Capturing selectedID in detail view
Capturing selectedID in detail view
For a detail view of a record, I want to display the selectedID of the record above the table heading. I'm using the header-extras.php file to add display it. When a user clicks on a record in table view, how to I capture the selectedID of the record so I can use it in header-extras.php?
Re: Capturing selectedID in detail view
Hi,
do you really mean in "[...] detail view [...] above the table heading"?
I think there is no table in detail view.
Perhaps you can upload a screenshot and highlight the place you mean?
Best,
Jan
do you really mean in "[...] detail view [...] above the table heading"?
I think there is no table in detail view.
Perhaps you can upload a screenshot and highlight the place you mean?
Best,
Jan
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.10 Revision 1579 + 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.10 Revision 1579 + all AppGini Helper tools
Re: Capturing selectedID in detail view
I want to capture the record ID and use it in header-extras.php. The header-extras.php file in the hooks folder always puts the extra text above the page heading. The image below is the detail view of a particular record. "Additional text goes here." indicates where the output from header-extras.php would appear.
Re: Capturing selectedID in detail view
If you want to add the selected id about the header of the detail view, let me give it a first try. It's a bit tricky to avoid showing the id only in detail view and not in table view. Maybe someone else here will have a different and better approach?
Code in hooks/header-extras.php for inserting the selected record id above the header of a detail view:
Is this what you were looking for?
Best,
Jan
Code in hooks/header-extras.php for inserting the selected record id above the header of a detail view:
Code: Select all
<?php
// file: hooks/header-extras.php
if (isset($_REQUEST["SelectedID"]) && $_REQUEST["current_view"]==="TV") { ?>
<h1 class="well text-center">Id: <?=$_REQUEST["SelectedID"]?></h1>
<?php } ?>
Is this what you were looking for?
Best,
Jan
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.10 Revision 1579 + 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.10 Revision 1579 + all AppGini Helper tools
Re: Capturing selectedID in detail view
That was exactly it! Thanks!
Re: Capturing selectedID in detail view
Hi
I do not trust the "TV" as it seems (for me not to be set consistent).
In my Column-Value-Based-Permissions, I am using this approach to see if a detailview is requested (see my footer and read docs in the extension zip):
If $checkSelectedID <> 0 then detailview requested.
Olaf
I do not trust the "TV" as it seems (for me not to be set consistent).
In my Column-Value-Based-Permissions, I am using this approach to see if a detailview is requested (see my footer and read docs in the extension zip):
Code: Select all
$checkSelectedID = isset($_POST['SelectedID']) ? makeSafe($_POST['SelectedID']) : 0;    // check POST first!
$checkSelectedID = isset($_GET['SelectedID']) ? makeSafe($_GET['SelectedID']) : $checkSelectedID;  // if GET exist, overwrite POST!
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view