ebs.hideLoadingPanel
(FintechOS Studio 20.2.1 and later)
Hides a loading screen animation.
Also see ebs.showLoadingPanel.
Syntax
Examples
In this example, we set up a button that calls a server-side process and displays a loading animation in the meanwhile. The script populates the interest field in the current form based on the interest rate and principal. If the call is not finalized in 20 seconds, the loading animation is interrupted and an error alert is displayed.
- We create a function called errorAlert that hides the loading animation and displays an error alert if the interest attribute hasn't been populated.
- For details on how to display alert windows, see ebs.alert.
- For details on how to access the current record's attributes, see formData.model.
- We create a click event handler for the calculateInterest button.
- We call the calculateInterest endpoint which exposes our server automation script and pass it the interestRate and principal input parameters. For details on how to call server automation scripts, see ebs.callActionByNameAsync.
- We display the loading animation using the ebs.showLoadingPanel function.
- We run the errorAlert function with a 20 seconds (20000 milliseconds) delay.
Copy
function errorAlert(){
if (formData.model.interest == null){
ebs.hideLoadingPanel();
ebs.alert({
title: 'Error',
message: '<p>Looks like this is taking longer than expected.<p><p>Try again later.</p>', yesButtonLabel: 'OK' })
}
}
$('#calculateInterest').on('click', function (event) {
ebs.callActionByNameAsync('calculateInterest', { 'interestRate': formData.model.interestRate, 'principal': formData.model.principal})
ebs.showLoadingPanel();
setTimeout(errorAlert, 20000);
});