Skip to content

Commit

Permalink
feat: add overlay api methods to show/hide overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Jul 3, 2019
1 parent 885f8b0 commit 9c3adad
Show file tree
Hide file tree
Showing 6 changed files with 13,474 additions and 6 deletions.
18 changes: 18 additions & 0 deletions BBjGridExWidget.bbj
Expand Up @@ -2455,6 +2455,24 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
methodret rows!
methodend
rem /**
rem * Show loading overlay
rem */
method public void showLoadingOverlay()
#executeScript("gw_showLoadingOverlay('" + #GRIDID$ + "')")
methodend
rem /**
rem * Show 'no rows' overlay
rem */
method public void showNoRowsOverlay()
#executeScript("gw_showNoRowsOverlay('" + #GRIDID$ + "')")
methodend
rem /**
rem * Clear all overlays
rem */
method public void hideOverlay()
#executeScript("gw_hideOverlay('" + #GRIDID$ + "')")
methodend
rem /**
rem * Excute script
rem *
rem * Excute a javascript code on the client
Expand Down
12,736 changes: 12,733 additions & 3 deletions client/dist/bbj-grid-widget.js

Large diffs are not rendered by default.

672 changes: 670 additions & 2 deletions client/dist/bbj-grid-widget.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/report.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/src/api/index.js
Expand Up @@ -13,5 +13,6 @@ export * from './cells.js';
export * from './state.js';
export * from './toolpanel.js';
export * from './statusbar.js';
export * from './overlays.js';
export * from './context.js';
export * from './jss.js';
51 changes: 51 additions & 0 deletions client/src/api/overlays.js
@@ -0,0 +1,51 @@
/*
* This file is part of the BBjGridExWidget plugin.
* (c) Basis Europe <eu@basis.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import { gw_getGrid } from "./utilities";

/**
* Show loading overlay
*
* @param {String} id the grid id
*/
export function gw_showLoadingOverlay(id) {
const grid = gw_getGrid(id);

if (grid) {
const options = gw_getGrid(id).options;
options.api.showLoadingOverlay()
}
}

/**
* Show 'no rows' overlay
*
* @param {String} id the grid id
*/
export function gw_showNoRowsOverlay(id) {
const grid = gw_getGrid(id);

if (grid) {
const options = gw_getGrid(id).options;
options.api.showNoRowsOverlay()
}
}

/**
* Clear all overlays
*
* @param {String} id the grid id
*/
export function gw_hideOverlay(id) {
const grid = gw_getGrid(id);

if (grid) {
const options = gw_getGrid(id).options;
options.api.hideOverlay()
}
}

0 comments on commit 9c3adad

Please sign in to comment.