DevExtreme v24.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

JavaScript/jQuery Load Panel

The JavaScript LoadPanel is an overlay component used to notify users that a process is in progress. In this demo, you can see how to initialize and configure the component.

DevExtreme Accessibility Compliance
DevExtreme component libraries meet a variety of WCAG and Section 508 compliance standards. To assess this demo’s accessibility level, click the Run AXE® Validation button to launch the AXE® web accessibility evaluation tool.
All trademarks or registered trademarks are property of their respective owners. AXE® Terms of Use
The overall accessibility level of your application depends on the LoadPanel features used.
Backend API
$(() => { const showLoadPanel = function () { loadPanel.show(); showEmployeeInfo({}); }; const showEmployeeInfo = function (employee) { $('.birth-date').text(employee.Birth_Date || ''); $('.city').text(employee.City || ''); $('.zipcode').text(employee.Zipcode || ''); $('.address-info').text(employee.Address || ''); $('.mobile-phone').text(employee.Mobile_Phone || ''); $('.email').text(employee.Email || ''); }; $('.show-panel').dxButton({ text: 'Load Data', onClick: showLoadPanel, }); const loadPanel = $('.loadpanel').dxLoadPanel({ shadingColor: 'rgba(0,0,0,0.4)', position: { of: '#employee' }, visible: false, showIndicator: true, showPane: true, shading: true, hideOnOutsideClick: false, onShown() { setTimeout(() => { loadPanel.hide(); }, 3000); }, onHidden() { showEmployeeInfo(employee); }, }).dxLoadPanel('instance'); $('.with-indicator').dxCheckBox({ value: true, text: 'With indicator', onValueChanged(e) { loadPanel.option('showIndicator', e.value); }, }); $('.with-overlay').dxCheckBox({ value: true, text: 'With overlay', onValueChanged(e) { loadPanel.option('shading', e.value); }, }); $('.with-pane').dxCheckBox({ value: true, text: 'With pane', onValueChanged(e) { loadPanel.option('showPane', e.value); }, }); $('.outside-click').dxCheckBox({ value: false, text: 'Hide on outside click', onValueChanged(e) { loadPanel.option('hideOnOutsideClick', e.value); }, }); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/24.1.6/css/dx.light.css" /> <script src="js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="container"> <div class="header">John Heart</div> <div class="show-panel"></div> <div id="employee"> <p> Birth date: <b class="birth-date"></b> </p> <p class="address"> Address:<br /> <b class="city"></b><br /> <span class="zipcode"></span> <span class="address-info"></span> </p> <p> Phone: <b class="mobile-phone"></b><br /> Email: <b class="email"></b> </p> </div> <div class="loadpanel"></div> <div class="options"> <div class="caption">Options</div> <div class="option"> <div class="with-indicator"></div> </div> <div class="option"> <div class="with-overlay"></div> </div> <div class="option"> <div class="with-pane"></div> </div> <div class="option"> <div class="outside-click"></div> </div> </div> </div> </div> </body> </html>
.header { font-size: 34px; display: inline-block; vertical-align: middle; padding: 10px; margin: 0; } #employee { margin: 20px 0; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; border-top: 1px solid lightgray; border-bottom: 1px solid lightgray; } #employee > p { padding: 10px 20px; margin: 0; } .address { height: 60px; } .options { padding: 20px; background-color: rgba(191, 191, 191, 0.15); margin-top: 20px; } .caption { font-size: 18px; font-weight: 500; } .option { margin-top: 10px; }
const employee = { Full_Name: 'John Heart', Title: 'CEO', Birth_Date: '03/16/1964', Prefix: 'Mr.', Address: '351 S Hill St.', City: 'Los Angeles', Zipcode: 90013, Email: 'jheart@dx-email.com', Skype: 'jheart_DX_skype', Home_Phone: '(213) 555-9208', Mobile_Phone: '(213) 555-9392', };

Show and Hide the Indicator and Pane

JavaScript LoadPanel elements (a message and an animated load indicator) are displayed on a pane. If you want to hide it, set the showPane property to false. You can also disable the showIndicator property to hide the animated load indicator. In this case, the JavaScript LoadPanel displays only the message. In this demo, you can use the "With indicator" and "With pane" checkboxes to change the visibility of the load indicator and pane.

Configure the Background Shade

When JavaScript LoadPanel is displayed, it shades the background. Use the shadingColor property to specify the color of the shade. You can also specify the element that should be shaded. For this, assign the element's CSS selector to the container property. If you do not want to shade the background, disable the shading property. In this demo, you can uncheck the "With overlay" checkbox to do it.

Show and Hide JavaScript LoadPanel

To change the JavaScript LoadPanel visibility in code, use the visible property. Alternatively, you can call the show() and hide() or toggle(showing) methods.

Users can hide JavaScript LoadPanel when they click outside it if you enable the hideOnOutsideClick property. Use the "Hide on outside click" checkbox to control this functionality in this demo.

JavaScript LoadPanel also allows you to handle the show and hide events. Use the onShowing and onHiding functions to handle the events before they occur and possibily cancel them. Use the onShown and onHidden functions to perform required actions after the events are raised.