Separate individual Child tables from the Child Tables tabs?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
peebee
AppGini Super Hero
AppGini Super Hero
Posts: 209
Joined: 2013-03-21 04:37

Separate individual Child tables from the Child Tables tabs?

Post by peebee » 2019-01-24 05:48

I have an app with completely customised Detail View templates based on bootstrap tabs/tables.

By default, Appgini Child Tables are displayed below the main detail view within their own tabbed format, which is elegant and perfect in most instances.

I can move those Child tabs anywhere I want by simply placing this code.

Code: Select all

<div class="row">
	<div class="col-lg-12">
	<div id="jobs-children" class="children-tabs"></div>
	</div>
</div>
What I would really like to achieve however is to place INDIVIDUAL child tables within my own template tabs. In other words, separate the child tables from their Child Table tabs and display each individual child table within their own bootstrap tab in my custom template. Sounds simple - doesn't appear to be though! :oops:

Any ideas how to simply/effectively separate the Child Tables from their tabbed format? Editing the parent_templateDV.html (or any other file for that matter) instead of a hook is not an issue for me as they are already completely customised. Thanks in advance for any suggestions.

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 519
Joined: 2018-04-01 10:12

Re: Separate individual Child tables from the Child Tables tabs?

Post by pböttcher » 2019-01-24 20:07

Hi,

if editing the parent_templateDV.html does not matter, you can try putting this in instead.

<ul class="nav nav-tabs">
<li class="active"><a href="#panel_PARENTTABLE-PARENTFIELD" id="tab_PARENTTABLE-PARENTFIELD" data-toggle="tab" aria-expanded="true">PARENTTABLE</a></li>
<div id="panel_PARENTTABLE-PARENTFIELD" class="tab-pane"><img src="loading.gif" align="top" />Loading ...</div>
</ul>

where

PARENTTABLE-PARENTFIELD is the lookuptable and lookupfield you reference.

and replicate it for each tab that you want to see.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 209
Joined: 2013-03-21 04:37

Re: Separate individual Child tables from the Child Tables tabs?

Post by peebee » 2019-01-25 00:59

Thanks pböttcher but sadly not so simple.

Required <scripts> from parent-children.php are not loaded without being wrapped in <div id="parenttable-children">. Without that <div>, you just end up with an empty Child panel but no table/data.

The problem is of course; adding the <div id="parenttable-children"> loads ALL the tabs - as tabs.

How to easily get the required scripts from parent-children.php to load for individual child table tabs?

I suppose I could possibly hide the <div id="parenttable-children"> or individual tabs but that hardly seems the correct solution?

This is code WITH <div id="parenttable-children"> loading
screenshot2.jpg
screenshot2.jpg (199.35 KiB) Viewed 479 times
And this is WITHOUT the <div id="parenttable-children">
screenshot3.jpg
screenshot3.jpg (67.61 KiB) Viewed 479 times

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 519
Joined: 2018-04-01 10:12

Re: Separate individual Child tables from the Child Tables tabs?

Post by pböttcher » 2019-01-25 21:13

ok, so if you do not want to hide :-) you can try to add this after the </ul>:

Code: Select all

	<script>
	$j(function(){
		post("parent-children.php", { ChildTable: "PARENTTABLE", ChildLookupField: "PARENTFIELD", SelectedID: $j("[name=SelectedID]").val(), Page: 1, SortBy: "", SortDirection: "", Operation: "get-records" }, "panel_PARENTTABLE-PARENTFIELD");
	})
	</script>

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 209
Joined: 2013-03-21 04:37

Re: Separate individual Child tables from the Child Tables tabs?

Post by peebee » 2019-01-29 00:09

Perfect! Thank you so very much. Really appreciated.

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 519
Joined: 2018-04-01 10:12

Re: Separate individual Child tables from the Child Tables tabs?

Post by pböttcher » 2019-01-29 07:19

Glad to see it is working :-)

Post Reply