Hi,
When I add a button to table view and click on the (Open) label, the SelectID parameter creates a URL with the name of the record's primary key and not the value I'm requesting:
Example;
.../northwind/customers_view.php?SelectedID=%CustomerID%
Of course I get the following Error:
Bad request
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.
APPGINI HELPER
Re: APPGINI HELPER
Don't know for sure if I got your point. Do you mean Button or Link?
If
If
If
.addButton
, you are in control of the javascript function being executed on click.If
.addLink
, the placeholder is %ID%
, NOT %CustomerID%
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: APPGINI HELPER
Thanks,
This is the code at customers-tv.js file:
jQuery(function () {
let tv = AppGiniHelper.TV;
let customers = tv.getTableName();
let href = customers + "_view.php?SelectedID=%CustomerID%";
tv.addLink(href, "search", "Open");
});
Pressing the button opens a URL that is this:
http://sebusca.com.mx/northwind/custome ... CustomerID%
I think that the %Customer ID% tag is not being replaced by the customer ID that I am selecting, that is my question
Regards
Esteban
This is the code at customers-tv.js file:
jQuery(function () {
let tv = AppGiniHelper.TV;
let customers = tv.getTableName();
let href = customers + "_view.php?SelectedID=%CustomerID%";
tv.addLink(href, "search", "Open");
});
Pressing the button opens a URL that is this:
http://sebusca.com.mx/northwind/custome ... CustomerID%
I think that the %Customer ID% tag is not being replaced by the customer ID that I am selecting, that is my question
Regards
Esteban
Re: APPGINI HELPER
As said above, the placeholder is %ID%, NOT %CustomerID%.
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: APPGINI HELPER
By the way, for just opening the row in Detail View, there is a shorthand function:
If you prefer a different icon or even text, you can pass those parameters:
I'm using this a lot. Actually, I am placing such code in a javascript function in
Additional Links
Additionally, I'm often adding extra buttons for directly opening child-records of a record. This requires master-child relations, built based on lookups, obviously. In the following case there is a master-table
As you can see in the code above, I'm just using the placeholder
---
Custom pages
You can also link to any other URL, for example to custom pages like this one:
It is the same principle.
Code: Select all
// file: hooks/TABLENAME-tv.js
jQuery(document).ready(function() {
AppGiniHelper.tv.addButtonOpen();
});
.addButtonOpen()
renders a button in every row. Check the URL at the bottom of the page in the following screenshot:If you prefer a different icon or even text, you can pass those parameters:
Code: Select all
AppGiniHelper.tv.addButtonOpen("triangle-right", "Öffnen")
hooks/header-extras.php
. Having such functions in a central place means it will render such buttons in every DV. I dont' have to place it in every single TABLENAME-dv.js.Additional Links
Additionally, I'm often adding extra buttons for directly opening child-records of a record. This requires master-child relations, built based on lookups, obviously. In the following case there is a master-table
partners
, having id
as primary key and mulitple child-tables (contacts
, calculations
, machines
), having a lookup column named partner_id
, each:Code: Select all
$j(document).ready(function() {
var tv = AppGiniHelper.TV;
tv
.addButtonOpen()
.addLink("contacts_view.php?filterer_partner_id=%ID%", "user", "...")
.addLink("calculations_view.php?filterer_partner_id=%ID%", "align-left", "...")
.addLink("machines_view.php?filterer_partner_id=%ID%", "cog", "...");
});
%ID%
in every added link URL. This placeholder will be replaced by each row's specific primary key on load.---
Custom pages
You can also link to any other URL, for example to custom pages like this one:
Code: Select all
AppGiniHelper.TV
.unlink()
.addButtonOpen()
.addLink("calculations_tree.php?SelectedID=%ID%", "align-left", "Struktur");
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: APPGINI HELPER
Hi,
Sorry for the delay, I had to go on a trip unexpectedly, thank you very much for your support.
Regards
Sorry for the delay, I had to go on a trip unexpectedly, thank you very much for your support.
Regards