DevExtreme jQuery/JS - Show and Hide Using the API

NOTE
In this article, the Button widget 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 widget following the same guidelines.

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

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