Hi zibrahim,
sure this helps. Thank you for pointing out the thread.
For my purpose I installed a new button below the child table - maybe someone else can make use of it (this solution will stay when you regenerate your application, but is's a little different approach than zibrahim's link shows):

- child_new_btn.png (5.32 KiB) Viewed 3945 times
The code I used was this the following. .. May be easier, but it works (I am no JS type of person). I placed it into the footer and adding the variable which holds all code to DV and TVDV footer:
Code: Select all
// START button
$customerhint = '<button type="button" class="btn btn-success hspacer-md" id="SOME_ID" title="SOME_TITLE"><i class="glyphicon glyphicon-plus-sign"></i> New WHATEVER</button>';
$customerhint = '<span class="customerhint">' . $customerhint . '</span>';
//show only once in footer below details table
$customerhint_kurz = "\n<script>\n
\$j(function() {
var k_cnter = 0;
var custxt = setInterval(custHint, 1000);
function custHint (){
var n = \$j('#panel_CHILDTABLENAME-PRIMARYKEYNAME').find('span.customerhint').length; //place outside of table to show count-badge
if (n < 1 ) {
//\$j('#panel_CHILDTABLENAME-PRIMARYKEYNAME tfoot tr td').append(' " . $customerhint . "')
\$j('#panel_CHILDTABLENAME-PRIMARYKEYNAME').append(' " . $customerhint . "'); //place outside of table to show count-badge
\$j('.customerhint').click(function(){
var link = '/AGTABLENAME_TO_ADD_NEW_RECORD.php?addNew_x=1&Embedded=1';
modal_window({
url: link,
size: 'full',
noAnimation: true,
title: 'TITLE SHOWN IN MODAL WINDOW HEADER', /* change that to the desired modal window title */
close: function() {
//do things on close of modal;
}
});
});
} else {
k_cnter++;
if (k_cnter > 20){
clearInterval(custHint);
}
}
};
})
\n</script>\n";
// show extra button only if current user has permissions to add to the table
$usr_has_permission = getTablePermissions('AGTABLENAME_TO_ADD_NEW_RECORD');
if ($usr_has_permission['insert'] != 1) {
$customerhint_kurz = '';
}
// END button
In the switch of the footer function I am using this to add the code:
Code: Select all
...
case 'detailview':
$footer = $customerhint_kurz. '<%%FOOTER%%>';
break;
case 'tableview+detailview':
$footer = $customerhint_kurz . '<%%FOOTER%%>';
break;
...
Olaf