UI Widgets LoadPanel

A widget used to indicate whether or not an element is loading.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/load_panel
LoadPanel interactive configuration
Copy code
$("#loadpanel").dxLoadPanel({
});

The LoadPanel widget represents an overlaying element indicating that loading is in progress.

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxLoadPanel jQuery plug-in.

    HTML
    <div id="loadPanel"></div>
    JavaScript
    $("#loadPanel").dxLoadPanel({
        message: 'Loading...',
        showIndicator: true
    });
  • Knockout
    Add a div element and apply the dxLoadPanel binding to this element.

    HTML
    <div data-bind="dxLoadPanel: {
        message: 'Loading...',
        showIndicator: true
    }"></div>
  • AngularJS
    Add a div element and apply the dx-load-panel directive to this element.

    HTML
    <div dx-load-panel="{
        message: 'Loading...',
        showIndicator: true
    }"></div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

You can find detailed information on the principles of working with the widget in the dxLoadPanel section of the Overlay Widgets article.

View Demo

Show Example:
AngularJS
Knockout
jQuery
<div ng-controller="demoController" style="height: 100%;">
    <div class="button" dx-button="{ text: 'Load', onClick: startLoading }"></div><br />
    <div id="myLoadPanel" dx-load-panel="{ 
        message: 'Loading...',
        bindingOptions: { 
            visible: 'loadPanelVisible' 
        }
    }"></div>
</div>
var myApp = angular.module('myApp', ['dx']);
myApp.controller("demoController", function ($scope) {
    $scope.loadPanelVisible = false,
    $scope.startLoading = function () {
        $scope.loadPanelVisible = true;
        setTimeout(finishLoading, 3000);
    };
    var finishLoading = function () {
        $("#myLoadPanel").dxLoadPanel("instance").option("visible", false);
    };
});
angular.element(document).ready(function () {
    angular.bootstrap(document, ['myApp']);
});
body {
    text-align: center;
}
.button {
    margin-top: 25px;
}
<div class="button" data-bind="dxButton:{ text: 'Load', onClick: startLoading }"></div>
<div data-bind="dxLoadPanel:{
    message: 'Loading...',
    visible: loadPanelVisible
}"></div>
var myViewModel = {
    loadPanelVisible: ko.observable(false),
    startLoading: function () {
        this.loadPanelVisible(true);
        setTimeout($.proxy(this.finishLoading, this), 3000);
    },
    finishLoading: function () {
        this.loadPanelVisible(false);
    }
}
ko.applyBindings(myViewModel);
body {
    text-align: center;
}
.button {
    margin-top: 25px;
}
<div class="button" id="loadButton"></div><br />
<div id="myLoadPanel"></div>
$("#myLoadPanel").dxLoadPanel({
    message: 'Loading...',
    visible: false
});
$("#loadButton").dxButton({
    text: 'Load',
    onClick: function () {
        $("#myLoadPanel").dxLoadPanel("instance").option("visible", true);
        setTimeout($.proxy(finishLoading, this), 3000);
    }
});
var finishLoading = function () {
    $("#myLoadPanel").dxLoadPanel("instance").option("visible", false);
}
body {
    text-align: center;
}
.button {
    margin-top: 25px;
}

Configuration

An object that defines configuration options for the LoadPanel widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.