I have created a report based on a lesson in Udemy Courses. Is there some code that I can add to the report that will prevent the button from being visible if the user is in a modal popup window such as when they enter an existing record to edit it?
Thank you again!
Hide button in Modal Pop up window
Re: Hide button in Modal Pop up window
This may have not been clear enough. The button to print the report is included in several of my tables while in Detail View. Clicking the button prints out a report of the data. I wish to have it so that when a person is viewing previously entered data in a modal pop up of detail view, such as when editing an existing record the button odes not appear.
Re: Hide button in Modal Pop up window
I'm not 100% sure but there could be a request parameter "Embedded" in standard AppGini generated DV model dialogs.
You may evaluate
before rendering the button.
You may evaluate
Code: Select all
(!$_REQUEST['Embedded'] == 1)
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: Hide button in Modal Pop up window
Hi again,
Where do I insert this code?
Where do I insert this code?
Re: Hide button in Modal Pop up window
I have this code in the hooks/table_name function table_name_dv. It determines if the window is Print Preview. Could another similar line be added to determine if it is a Modal Popup?
Code: Select all
if(isset($_REQUEST['dvprint_x'])) return;
Re: Hide button in Modal Pop up window
At the place you create "the button". I don't know in which file you do this.Is there some code that I can add to the report that will prevent the button from being visible
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: Hide button in Modal Pop up window
I have this code in Hooks/table_name_dv function.
Code: Select all
function audit_dv($selectedID, $memberInfo, &$html, &$args) {
/* if this is the print preview, don't modify the detail view */
if(isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
<?php if($selectedID){ ?>
$j('#audit_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-warning btn-lg" onclick="print_report()">' +
'<i class="glyphicon glyphicon-eye-open"></i> Print Report</button>' +
'</div>'
);
<?php } ?>
});
function print_report(){
var selectedID = '<?php echo urlencode($selectedID); ?>';
window.location = 'hooks/audit_rpt_print.php?audit_id=' + selectedID;
}
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html .= $form_code;
}
Re: Hide button in Modal Pop up window
Hi again,
I'm stumped. I got some advice from Ahmed and have been experimenting with it and the similar code you provided. I have been able to remove all the buttons on the page in question, but they are removed weather the page is modal or not. If I leave the .val()) with no value, nothing happens. If I set it as .val(1)) -- then the buttons are removed in both modal and normal mode. I have placed the code into the hooks/firstaid.php file in the firstaid_dv function and also in the header and footer extras files with the same results.
If there is anything I can tell you to help me solve how to remove a button or group of buttons while in MODAL view. Please let me know.
Thanks for any additional assistance...
Ray
I'm stumped. I got some advice from Ahmed and have been experimenting with it and the similar code you provided. I have been able to remove all the buttons on the page in question, but they are removed weather the page is modal or not. If I leave the .val()) with no value, nothing happens. If I set it as .val(1)) -- then the buttons are removed in both modal and normal mode. I have placed the code into the hooks/firstaid.php file in the firstaid_dv function and also in the header and footer extras files with the same results.
Code: Select all
$j(function() {
if($j('[firstaid_dv ="Embedded"]').val())
$j('#firstaid_dv_action_buttons .btn-toolbar').remove();
});
Thanks for any additional assistance...
Ray