Page 1 of 1

Separate individual Child tables from the Child Tables tabs?

Posted: 2019-01-24 05:48
by peebee
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.

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

Posted: 2019-01-24 20:07
by pbottcher
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.

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

Posted: 2019-01-25 00:59
by peebee
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 2741 times
And this is WITHOUT the <div id="parenttable-children">
screenshot3.jpg
screenshot3.jpg (67.61 KiB) Viewed 2741 times

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

Posted: 2019-01-25 21:13
by pbottcher
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>

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

Posted: 2019-01-29 00:09
by peebee
Perfect! Thank you so very much. Really appreciated.

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

Posted: 2019-01-29 07:19
by pbottcher
Glad to see it is working :-)