IClientSideWebPartStatusRenderer interface
Interface to be implemented by a component that should display the loading indicator and error messages for a web part.
Methods
clear |
Clear the webpart error message. |
clear |
Clear the loading indicator. |
display |
Display a loading spinner. |
render |
Render the provided error message in the webpart container div. |
Method Details
clearError(domElement)
Clear the webpart error message.
clearError(domElement: HTMLElement): void;
Parameters
- domElement
-
HTMLElement
the web part container div.
Returns
void
clearLoadingIndicator(domElement)
Clear the loading indicator.
clearLoadingIndicator(domElement: Element): void;
Parameters
- domElement
-
Element
the web part container div.
Returns
void
displayLoadingIndicator(domElement, loadingMessage, timeout, clearDomElementCallback)
Display a loading spinner.
displayLoadingIndicator(domElement: Element, loadingMessage: string, timeout?: number, clearDomElementCallback?: ClearDomElementCallback): void;
Parameters
- domElement
-
Element
the web part container div.
- loadingMessage
-
string
the message to be displayed when the loading spinner id displayed.
- timeout
-
number
timeout to render the loading indicator. Default is 1500ms.
- clearDomElementCallback
- @microsoft/sp-webpart-base!~ClearDomElementCallback:type
Callback to clear the dom node before rendering the indicator. Standard DOM API will be used after the callback.
Returns
void
renderError(domElement, error, clearDomElementCallback)
Render the provided error message in the webpart container div.
renderError(domElement: HTMLElement, error: Error | string, clearDomElementCallback?: ClearDomElementCallback): void;
Parameters
- domElement
-
HTMLElement
the web part container div.
- error
-
Error | string
the error message.
- clearDomElementCallback
- @microsoft/sp-webpart-base!~ClearDomElementCallback:type
Callback to clear the dom node before rendering the error element. Standard DOM API will be used after the callback.
Returns
void