LoadPanel Configuration

An object that defines configuration options for the dxLoadPanel widget.

animation

An object that represents widget animation options.

Type: Object
Default Value: null

See the UI Widgets topic to learn how to configure animation options used to show and hide the widget.

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div class="dx-fieldset">
  <div class="dx-field">
    <div style="width: 70%" class="dx-field-label">Animation Type</div>
    <div style="width: 30%" class="dx-field-value" data-bind="dxLookup: {
      dataSource: animationTypes,
      value: animationType,
      valueChangeAction: typeChanged
    }"></div>
  </div>
</div>
<div id="myLoadPanel" data-bind="dxLoadPanel: {
  message: 'Loading...',
  visible: loadPanelVisible,
  animation: animationConfig
}"></div>
animationTypes = [
  "fade",
  "pop",
  "slide"
];
loadPanelVisible = ko.observable(false);
animationType = ko.observable(animationTypes[0]);
animationConfig = ko.observable({});
typeChanged = function () {
  switch (animationType()) {
    case "slide":
      animationConfig({
        show: { type: "slide", from: { top: -$("#myLoadPanel").height() }, to: { top: 0 } },
        hide: { type: "slide", from: { top: 0 }, to: { top: -$("#myLoadPanel").height() } }
      });
      break;
    case "pop":
      animationConfig({
        show: { type: "pop", from: { scale: 0 }, to: { scale: 1 } },
        hide: { type: "pop", from: { scale: 1 }, to: { scale: 0 } }
      });
      break;
    case "fade":
      animationConfig({
        show: { type: "fade", from: 0, to: 1 },
        hide: { type: "fade", from: 1, to: 0 }
      });
      break;
    default:
      animationConfig({});
  }
}
startLoading = function () {
  loadPanelVisible(true);
  setTimeout($.proxy(this.finishLoading, this), 2000);
};
finishLoading = function () {
  loadPanelVisible(false);
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

clickAction

An action performed when the widget is clicked.

Type: Action
Default Value: null

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div data-bind="dxLoadPanel: {
  message: 'Loading...',
  visible: loadPanelVisible,
  clickAction: processClick
}"></div>
loadPanelVisible = ko.observable(false);
startLoading = function () {
  loadPanelVisible(true);
  setTimeout($.proxy(this.finishLoading, this), 3000);
};
finishLoading = function () {
  loadPanelVisible(false);
};
processClick = function () {
  DevExpress.ui.dialog.alert("The widget has been clicked", "Action executed");
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

closeOnOutsideClick

A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window.

Type: Boolean
Default Value: false

height

The height of the widget.

Type: Number
Default Value: 70

The option can hold a value of the following types:

  • numeric - the height of the widget in pixels;
  • string - a CSS measurement of the widget height (e.g., "55px", "80%", "auto" and "inherit");
  • function - a function returning the widget height (e.g., height:function(){ return baseHeight - 10 + "%"; }).

hiddenAction

An action performed after the widget is hidden.

Type: Action
Default Value: null

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div data-bind="dxLoadPanel: {
    message: 'Loading...',
    visible: loadPanelVisible,
    hiddenAction: processHiding
}"></div>
loadPanelVisible = ko.observable(false);
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 2000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
processHiding = function () {
  DevExpress.ui.dialog.alert("The widget has been hidden", "Action executed");
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

hiddingAction

An action performed before hiding the widget.

Type: Action
Default Value: null

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div data-bind="dxLoadPanel: {
    message: 'Loading...',
    visible: loadPanelVisible,
    hiddingAction: processHiding
}"></div>
loadPanelVisible = ko.observable(false);
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 2000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
processHiding = function () {
  DevExpress.ui.dialog.alert("The widget is being hidden", "Action executed");
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

message

The text displayed in the load panel.

Type: String
Default Value: "Loading ..."

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div class="dx-fieldset">
  <div class="dx-field">
    <div class="dx-field-label">Message</div>
    <div class="dx-field-value" data-bind="dxTextBox: { value: loadPanelMessage }"></div>
  </div>
</div>
<div data-bind="dxLoadPanel: {
  message: loadPanelMessage,
  visible: loadPanelVisible,
  shading: false,
  clickAction: processClick
}"></div>
loadPanelVisible = ko.observable(false);
loadPanelMessage = ko.observable("Load panel message");
startLoading = function () {
  loadPanelVisible(true);
  setTimeout($.proxy(this.finishLoading, this), 2000);
};
finishLoading = function () {
  loadPanelVisible(false);
};
processClick = function () {
  DevExpress.ui.notify("The widget has been clicked", "info", 1000);
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

position

An object defining overlay positioning options.

Type: Object

The postion option takes on an object containing the following fields: my, at and of. Look at the following sentence to see how to use these fields to position the required element against the target element.

"Place my 'left' side at the 'left bottom' corner of the '#targetElement'." The italic quoted phrase located after each option name within the sentence represents a value of the appropriate option.

Show Example:
jQuery
<div class="button" data-bind="dxButton: { text: 'Start loading', clickAction: startLoading }"></div>
<p style="text-align:center"><b>Position</b></p>
<div class="dx-fieldset">
  <div class="dx-field">
    <div class="dx-field-label">my</div>
    <div class="dx-field-value" data-bind="dxLookup: { dataSource: positionValues, value: myValue }"></div>
  </div>
  <div class="dx-field">
    <div class="dx-field-label">at</div>
    <div class="dx-field-value" data-bind="dxLookup: { dataSource: positionValues, value:atValue }"></div>
  </div>
</div>
<div id="targetElement"></div>
<div id="myLoadPanel" data-bind="dxLoadPanel: {
    message: 'Loading...',
    visible: loadPanelVisible,
    position: {
        my: myValue(),
        at: atValue(),
        of: $('#targetElement')
    }
}"></div>
loadPanelVisible = ko.observable(false);
atValue = ko.observable("bottom");
myValue = ko.observable("bottom");
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 2000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
positionValues = [
  "left top",
  "top",
  "right top",
  "right",
  "right bottom",
  "bottom",
  "left bottom",
  "left",
  "center"
];
body{
  text-align: center;
}
.button{
  margin: 10px;
}
.overlayContents{
  color: darkblue;
  background-color:darkorange;
  border-radius: 15px;
  height:100%;
}
#targetElement {
  margin-top: 40px;
  display: inline-block;
  width: 80%;
  height: 170px;
  border-style: solid;
  background-color: lightgreen;
}

shading

A Boolean value specifying whether or not the main screen is inactive while the overlay is active.

Type: Boolean
Default Value: true

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div data-bind="dxLoadPanel: {
    message: 'Loading...',
    visible: loadPanelVisible,
    shading: loadPanelShading
}"></div>
<div class="dx-fieldset">
  <div class="dx-field">
    <div class="dx-field-label">Shading</div>
    <div class="dx-field-value" data-bind="dxCheckBox: { checked: loadPanelShading }"></div>
  </div>
</div>
loadPanelVisible = ko.observable(false);
loadPanelShading = ko.observable(true);
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 2000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

showIndicator

A Boolean value specifying whether or not to show a load indicator.

Type: Boolean
Default Value: true

If this option is set to true, a message is displayed and a load indicator is turning in a circle while the view's content is loaded. Set this option to false to display only the text message. This can help you avoid problems with animation used for the load indicator when running on a slow device.

Show Example:
jQuery
<div id="button" data-bind="dxButton:{text: 'Load', clickAction: startLoading}"></div>
<div data-bind="dxLoadPanel:{message: 'Loading...', visible: loadPanelVisible, showIndicator: userShowIndicator}"></div>
<div class="dx-fieldset">
  <div class="dx-field">
    <div style="width:70%" class="dx-field-label">Show indicator</div>
    <div class="dx-field-value" data-bind="dxCheckBox: { checked: userShowIndicator }"></div>
  </div>
</div>
userShowIndicator = ko.observable(true);
loadPanelVisible = ko.observable(false);
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 3000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
body {
  text-align: center;
}
#button {
  margin-top: 25px;
}

showingAction

An action performed before showing the overlay.

Type: Action
Default Value: null

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div data-bind="dxLoadPanel: {
    message: 'Loading...',
    visible: loadPanelVisible,
    showingAction: processShowing
}"></div>
loadPanelVisible = ko.observable(false);
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 3000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
processShowing = function () {
  DevExpress.ui.dialog.alert("The widget is being shown", "Action executed");
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

shownAction

An action performed after the widget is shown.

Type: Action
Default Value: null

Show Example:
jQuery
<div id="button" data-bind="dxButton: { text: 'Load', clickAction: startLoading }"></div>
<div data-bind="dxLoadPanel: {
    message: 'Loading...',
    visible: loadPanelVisible,
    shownAction: processShowing
}"></div>
loadPanelVisible = ko.observable(false);
startLoading = function () {
    loadPanelVisible(true);
    setTimeout($.proxy(this.finishLoading, this), 3000);
};
finishLoading = function () {
    loadPanelVisible(false);
};
processShowing = function () {
  DevExpress.ui.dialog.alert("The widget has been shown", "Action executed");
};
body{
  text-align: center;
}
.button{
  margin: 10px;
}

visible

A Boolean value specifying whether or not the widget is visible.

Type: Boolean
Default Value: false

You can show and hide the widget by changing the value of an observable variable passed to this option.

Show Example:
jQuery
<div class="dx-fieldset">
  <div class="dx-field">
    <div class="dx-field-label">Visible</div>
    <div class="dx-field-value" data-bind="dxCheckBox: { checked: loadPanelVisible }"></div>
  </div>
</div>
<div class="loadPanel" data-bind="dxLoadPanel: {
    message: 'Loading...',
    shading: false,
    visible: loadPanelVisible
}"></div>
loadPanelVisible = ko.observable(false);
loadPanelVisible.subscribe(function (newValue) {
    if (newValue)
        startTimer();
});
startTimer = function () {
    setTimeout(function () {
        loadPanelVisible(false);
    }, 2000);
};
body{
  text-align: center;
}
.button {
    margin: 10px;
}

width

The width of the widget.

Type: Number
Default Value: 200

The option can hold a value of the following types.

  • numeric - the widget width in pixels
  • string - a CSS measurement of the widget width (e.g., "55px", "80%", "auto" and "inherit")
  • function - the function returning the widget width (e.g., width:function(){ return baseWidth - 10 + "%"; })