Skip to content

sud.showLoading ​

Displays a loading indicator. Call sud.hideLoading when the task ends.

javascript
sud.showLoading(object);

Parameters ​

PropertyTypeRequiredDescription
titlestringYesText to display
maskbooleanNoWhether to display a transparent overlay that blocks touch events from reaching the content beneath it; set explicitly
successfunctionNoCalled on success; no additional result fields
failfunctionNoCalled on failure; see the fields below
completefunctionNoCalled after success or failure, with no arguments

Failure Callback Parameters ​

PropertyTypeDescription
errCodenumberError code
errMsgstringError description

Usage Notes ​

Confirm that the target app supports this UI feature before using it. Successfully displaying the indicator does not mean that the business task has finished. Close the indicator when the task succeeds, fails, or is canceled.

Example ​

javascript
sud.showLoading({
  title: 'Loading',
  mask: true,
  fail(error) {
    console.error('Failed to show loading indicator', error.errCode, error.errMsg);
  }
});