table view customizations

Discussions related to customizing hooks. Hooks are documented at
Post Reply
Veteran Member
Posts: 318
Joined: 2015-12-23 16:52

table view customizations

Post by grimblefritz » 2016-07-15 03:30

I've seen a few questions about this, so after finally digging into it myself -- I thought I'd share.

Basically, the following code hooks/tablename-tv.js tweaks a few column headings and adds a breadcrumb.

One of the major annoyances of AG is that, once you've opened a table, then a detail record, then child records - there's no clean way to get back to the parent detail record.

This hook fixes that.

Code: Select all

// hooks/order_items-tv.js


  // right align a couple of table headers

  // add a back-to-orders link if item table view with a filter set

  var view=$j('#current_view').val();
  var id=$j('input[name="filterer_orders_id"]').val()*1;

  if(view=='TV' && id>0){

    var linktext='<a style="text-decoration: none; color: inherit;" href="orders_view.php?SelectedID='+id+'"><img src="resources/table_icons/cart.png"> Orders </a> ';



When this is implemented, and you drill into order items from an order detail view, then the child (order items) table view will have two icons/titles above it - one that takes you back to the orders record where you came from, and the other will switch you to a global order items view (same as AG has always done.)

Of course, you can tweak the hook. Drop the image. Alter the url. Don't add a new <a> tag, but alter the existing one. Just depends on your skills with jquery. And google :-)


Veteran Member
Posts: 65
Joined: 2013-12-11 15:59

Re: table view customizations

Post by Bertv » 2016-07-15 10:11

thank you for sharing this script. It works great.
I am using Appgini 5.75

AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: table view customizations

Post by DevGiu » 2016-11-02 12:32

Well, Based on grimblefritz code, I think I improved this a little more.

I have a global js file with this function (change the name as you wish)

Code: Select all

function titulo_vista_referencia_documento(tabladetalle, tablacabecera){
	var view=$j('#current_view').val();
	var cabecera = (tabladetalle == tablacabecera);
	var enlacetitulo = 	(cabecera ? tablacabecera : tabladetalle);

	if (!cabecera)
		var id=$j('input[name="filterer_documento_id"]').val()*1;
		var id=$j('input[name="SelectedID"]').val()*1;

	var referencia = '';

	if (!cabecera) {
		var linktext='<a style="text-decoration: none; color: inherit;" href="' + tablacabecera + '_view.php?SelectedID='+id+'"> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> Volver </a> ';
Now, for your details views, you can create their magic file for table_view (<table>-tv.js)
And write this code

Code: Select all

  titulo_vista_referencia_documento('fac_det_fac_s', 'fac_cab_fac_s');
'fac_det_fac_s' is your detail table
'fac_cab_fac_s' is your parent table.

Now, every detail table you wrote this, you get a "back" button like the screenshot.

Note: Remember to change the text "Volver" to your lang.
screenshot_041.png (14.17 KiB) Viewed 3247 times
Professional Outsourcing Services

Posts: 1
Joined: 2019-01-03 15:59

Re: table view customizations

Post by svassell » 2019-01-12 15:27

This is a super useful item for my app. I've attempted to add this to my app with no success. The text is in Spanish which I've tried to translate: Can someone please provide some guidance on the following?
Where do I save the global.js file?
Is the syntax correct?
When adding to the detail and add new pages where does it go?

function get_breadcrumbs(detailed_table, headboard){
var view=$j('#current_view').val();
var headboard = (detailed_table == headboard);
var linktitle = (headboard ? headboard : detailed_table);

if (!headboard)
var id=$j('input[name="filterer_document_id"]').val()*1;
var id=$j('input[name="SelectedID"]').val()*1;

var reference = '';

if (!headboard) {
var linktext='<a style="text-decoration: none; color: inherit;" href="' + headboard + '_view.php?SelectedID='+id+'"> <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> Return </a> ';

-- Added to the detail page
get_breadcrumbs('hm_property_details.php', 'hm_property.php');
As always your help is greatly appreciated.

Post Reply