JavaScript/jQuery LoadIndicator - Show and Hide Using the API

NOTE
In this article, the Button UI component is used to demonstrate how to show and hide the LoadIndicator. This choice is made for purely demonstrational purposes, and you can do the same operations using another UI component following the same guidelines.

To specify whether the LoadIndicator is shown, change the visible property.

HTML
JavaScript
  • <div id="loadIndicatorContainer"></div>
  • <div id="buttonContainer"></div>
  • $(function() {
  • const loadIndicator = $("#loadIndicatorContainer").dxLoadIndicator({
  • visible: false
  • }).dxLoadIndicator("instance");
  •  
  • $("#buttonContainer").dxButton({
  • text: "Toggle the LoadIndicator",
  • onClick: function () {
  • const isLoadIndicatorVisible = loadIndicator.option("visible");
  • loadIndicator.option("visible", !isLoadIndicatorVisible);
  • }
  • });
  • });
See Also