React TreeList - 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.
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
$(function() { $("#treeListContainer").dxTreeList({ loadPanel: { enabled: true } }); });
Angular
<dx-tree-list ... > <dxo-load-panel [enabled]="true"> </dxo-load-panel> </dx-tree-list>
import { DxTreeListModule } from "devextreme-angular"; // ... export class AppComponent { // ... } @NgModule({ imports: [ // ... DxTreeListModule ], // ... })
You can also control the load panel programmatically using the beginCustomLoading(messageText) and endCustomLoading() methods.
jQuery
var treeList = $("#treeListContainer").dxTreeList("instance"); treeList.beginCustomLoading(); // ... treeList.endCustomLoading();
Angular
import { ..., ViewChild } from "@angular/core"; import { DxTreeListModule, DxTreeListComponent } from "devextreme-angular"; // ... export class AppComponent { @ViewChild(DxTreeListComponent, { static: false }) treeList: DxTreeListComponent; // Prior to Angular 8 // @ViewChild(DxTreeListComponent) treeList: DxTreeListComponent; doSomeLongOperation () { this.treeList.instance.beginCustomLoading(); // ... this.treeList.instance.endCustomLoading(); } } @NgModule({ imports: [ // ... DxTreeListModule ], // ... })
Since the load panel is a DevExtreme LoadPanel UI component, you can declare any properties of this UI component in the TreeList'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
$(function() { $("#treeListContainer").dxTreeList({ loadPanel: { height: 100, width: 250, indicatorSrc: "https://js.devexpress.com/Content/data/loadingIcons/rolling.svg" } }); });
Angular
<dx-tree-list ... > <dxo-load-panel [height]="100" [width]="250" indicatorSrc="https://js.devexpress.com/Content/data/loadingIcons/rolling.svg"> </dxo-load-panel> </dx-tree-list>
import { DxTreeListModule } from "devextreme-angular"; // ... export class AppComponent { // ... } @NgModule({ imports: [ // ... DxTreeListModule ], // ... })
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.