How do I edit the code to make the button open in a new window on a child record?
// child table: starmath
$res = sql("SELECT `st_id` FROM `students` WHERE `st_id`='{$selected_id}'", $eo);
$st_id = db_fetch_row($res);
$rires = sql("SELECT COUNT(1) FROM `starmath` WHERE `student`='" . makeSafe($st_id[0]) . "'", $eo);
$rirow = db_fetch_row($rires);
if($rirow[0] && !$AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation["couldn't delete"];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
return $RetMsg;
} elseif($rirow[0] && $AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation['confirm delete'];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
$RetMsg = str_replace('<Delete>', '<input type="button" class="button" value="' . $Translation['yes'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '&delete_x=1&confirmed=1\';">', $RetMsg);
$RetMsg = str_replace('<Cancel>', '<input type="button" class="button" value="' . $Translation[ 'no'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '\';">', $RetMsg);
return $RetMsg;
}
I need child record button to open in new window
Re: I need child record button to open in new window
Hi,
can you be a bit more specific. I do not see a button in this code.
can you be a bit more specific. I do not see a button in this code.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: I need child record button to open in new window
Is this the button?
<a class="visible-xs btn btn-default btn-lg btn-block hidden vspacer-sm" href="Contacts_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="xs_Contacts_link"><i class="glyphicon glyphicon-list-alt"></i> Contacts</a>
<a class="visible-xs btn btn-default btn-lg btn-block hidden vspacer-sm" href="Contacts_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="xs_Contacts_link"><i class="glyphicon glyphicon-list-alt"></i> Contacts</a>
Re: I need child record button to open in new window
<a class="hidden-xs btn btn-default btn-lg pull-right hidden hspacer-sm" href="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="starmath_link"><i class="glyphicon glyphicon-list-alt"></i> STAR Math</a>
<a class="visible-xs btn btn-default btn-lg btn-block hidden vspacer-sm" href="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="xs_starmath_link"><i class="glyphicon glyphicon-list-alt"></i> STAR Math</a>
<input type="hidden" id="starmath_hclink" value="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>">
<div class="clearfix"></div>
</div>
<a class="visible-xs btn btn-default btn-lg btn-block hidden vspacer-sm" href="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="xs_starmath_link"><i class="glyphicon glyphicon-list-alt"></i> STAR Math</a>
<input type="hidden" id="starmath_hclink" value="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>">
<div class="clearfix"></div>
</div>
Re: I need child record button to open in new window
Hi,
that is a least a link that will be displayed like a button.
Can you make a screenshot to show where you want to click to open the record in a new window.
that is a least a link that will be displayed like a button.
Can you make a screenshot to show where you want to click to open the record in a new window.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: I need child record button to open in new window
These are the child tables for my "students" table. I want them to open in a new tab.
- Attachments
-
- Capture.JPG (27.68 KiB) Viewed 2445 times
Re: I need child record button to open in new window
For standard child-link buttons (at the top of your detail view) you can use following javascript:
Code: Select all
// file: hooks/TABLENAME-dv.js
$j(".children-links > a").attr("target", "_blank");
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: I need child record button to open in new window
I do not have that file in my hooks folder.
- Attachments
-
- notthere.JPG (18.71 KiB) Viewed 2402 times
Re: I need child record button to open in new window
Just create that file and put the code in.
Just a warning, as the child table load later, you need to make sure that your code will execute once the child table is available.
See also
viewtopic.php?f=7&t=4147&p=16241&hilit= ... ble#p16241
Just a warning, as the child table load later, you need to make sure that your code will execute once the child table is available.
See also
viewtopic.php?f=7&t=4147&p=16241&hilit= ... ble#p16241
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.