|
import { createSpinner, showSpinner, hideSpinner } from "@syncfusion/ej2-popups";
export class DefaultFunctionalities extends SampleBase {
hideClicked() {
hideSpinner(document.getElementById("targetElement"));
}
showClicked() {
showSpinner(document.getElementById("targetElement"));
}
componentDidMount() {
//createSpinner() method is used to create spinner
// The createSpinner is called in componentDidMount because the target element need to be DOM before creating the spinner.
createSpinner({
// Specify the target for the spinner to show
target: document.getElementById("targetElement")
});
// showSpinner() will make the spinner visible
showSpinner(document.getElementById("targetElement"));
}
render() {
return (
<div className="control-pane">
<button onClick={this.showClicked}>Show Spinner</button>
<button onClick={this.hideClicked}>Hide Spinner</button>
<div
id="targetElement"
className="control-section col-lg-12 spinner-target"
/>
</div>
);
}
} |
export function spinnerCreator() {
createSpinner({ target: document.getElementById("mainContainer")});
}
export function spinnerShow() {
showSpinner(document.getElementById("mainContainer"));
}
export function spinnerHide() {
hideSpinner(document.getElementById("mainContainer"));
}
|
showClicked() {
showSpinner(document.getElementById("targetElement"));
document.getElementById("targetElement").querySelector(".e-spinner-pane").style.zIndex = "1000";
} |
|
createSpinner({
// Specify the target for the spinner to show
target: document.getElementById("targetElement"),
// This text will be displayed below the spinner
label: "Please Wait",
// This will add the grey background for the spinner target element
cssClass: "e-spin-overlay"
}); |