sud.showLoading
Displays a loading indicator. Call sud.hideLoading when the task ends.
javascript
sud.showLoading(object);Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Text to display |
| mask | boolean | No | Whether to display a transparent overlay that blocks touch events from reaching the content beneath it; set explicitly |
| success | function | No | Called on success; no additional result fields |
| fail | function | No | Called on failure; see the fields below |
| complete | function | No | Called after success or failure, with no arguments |
Failure Callback Parameters
| Property | Type | Description |
|---|---|---|
| errCode | number | Error code |
| errMsg | string | Error 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);
}
});