Help us shape the 2021 DevExtreme Roadmap. Take our 5 minute survey.
Dismiss

Load Panel

The load panel is displayed while the UI component loads data. It consists of a loading indicator and text, both placed on a pane.

DevExtreme HTML5/JavaScript DataGrid UI component - Load Panel

The load panel is shown only for remote data sources by default. To show it regardless of the data source type, assign true to the loadPanel.enabled property. Setting the same property to false disables the load panel completely.

jQuery
JavaScript
$(function() {
    $("#dataGridContainer").dxDataGrid({
        loadPanel: {
            enabled: true
        }
    });
});
Angular
HTML
TypeScript
<dx-data-grid ... >
    <dxo-load-panel
        [enabled]="true">
    </dxo-load-panel>
</dx-data-grid>
import { DxDataGridModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxDataGridModule
    ],
    // ...
})

You can also control the load panel programmatically using the beginCustomLoading(messageText) and endCustomLoading() methods.

jQuery
JavaScript
var dataGrid = $("#dataGridContainer").dxDataGrid("instance");
dataGrid.beginCustomLoading();
// ...
dataGrid.endCustomLoading();
Angular
TypeScript
import { ..., ViewChild } from "@angular/core";
import { DxDataGridModule, DxDataGridComponent } from "devextreme-angular";
// ...
export class AppComponent {
    @ViewChild(DxDataGridComponent, { static: false }) dataGrid: DxDataGridComponent;
    // Prior to Angular 8
    // @ViewChild(DxDataGridComponent) dataGrid: DxDataGridComponent;
    doSomeLongOperation () {
        this.dataGrid.instance.beginCustomLoading();
        // ...
        this.dataGrid.instance.endCustomLoading();
    }
}
@NgModule({
    imports: [
        // ...
        DxDataGridModule
    ],
    // ...
})

Since the load panel is a DevExtreme LoadPanel UI component, you can declare any properties of this UI component in the DataGrid's loadPanel object. For example, you can change the panel's size with the height and width properties, or employ another loading indicator using the indicatorSrc property.

jQuery
JavaScript
$(function() {
    $("#dataGridContainer").dxDataGrid({
        loadPanel: {
            height: 100,
            width: 250,
            indicatorSrc: "https://js.devexpress.com/Content/data/loadingIcons/rolling.svg"
        }
    });
});
Angular
HTML
TypeScript
<dx-data-grid ... >
    <dxo-load-panel
        [height]="100"
        [width]="250"
        indicatorSrc="https://js.devexpress.com/Content/data/loadingIcons/rolling.svg">
    </dxo-load-panel>
</dx-data-grid>
import { DxDataGridModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxDataGridModule
    ],
    // ...
})
See Also