Skip to content

Version > 2023.02

DV: Show Overlay

Plain Text Overlay

1
2
// file: hooks/TABLENAME-dv.js
AppGiniHelper.DV.showOverlay('Please wait: reloading page...');

HTML Text Overlay

1
AppGiniHelper.DV.showOverlay('<b>Reloading page</b><br/>Please be patient', true);

Example

For example when opening a modal dialog using AppGini's modal_window()-function, configure the close-callback in options. Inside that close-callback, show the overlay, then reload the current page.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!-- this could be part of a custom page, for example -->

<button type="button" id="btn-TABLENAME-create" class="btn btn-primary btn-lg">
        Create new TABLENAME record
</button>

<script>
    jQuery("#btn-TABLENAME-create").on("click", function() {
        // configure modal dialog options
        const options = {
            title: 'Create New Record Of TABLENAME',
            size: 'full',
            url: 'TABLENAME_view.php?addNew_x=1&Embedded=1',
            close: function() {
                // due to this configured close-property
                // on close of modal dialog this
                // callback function will be executed:
                // show overlay window with text
                AppGiniHelper.DV.showOverlay('Please wait: reloading page...');
                // reload page
                window.location.reload();
            }
        };
        // now open modal dialog with given options
        modal_window(options);
    });
</script>

Tips

  • You can use AppGiniHelper.DV.showOverlay and AppGiniHelper.TV.showOverlay even in custom pages
    (where actually there is no .DV/.TV defined).

See also