-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Box
- Responsive Box
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
-
Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
- Overview
-
Action Sheet
-
Button
- Floating Action Button
- Drop Down Button
-
Context Menu
-
List
-
Lookup
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
React Tree List - Load Data on Demand
The TreeList can load a remote dataset dynamically as a user expands nodes. The dataset must have a plain structure.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
import React from 'react';
import {
TreeList, RemoteOperations, Column,
} from 'devextreme-react/tree-list';
import 'whatwg-fetch';
const dataSource = {
async load(loadOptions) {
const parentIdsParam = loadOptions.parentIds;
const url = new URL('https://js.devexpress.com/Demos/Mvc/api/treeListData');
if (parentIdsParam) {
parentIdsParam.forEach((id: string) => {
url.searchParams.append('parentIds', id);
});
}
const result = await fetch(url.toString());
if (result.status === 200) {
return result.json();
}
throw new Error('Data Loading Error');
},
};
const customizeText = (e) => {
if (e.value !== null) {
return `${Math.ceil(e.value / 1024)} KB`;
}
return null;
};
const App = () => (
<TreeList
id="treelist"
dataSource={dataSource as any}
showBorders={true}
keyExpr="id"
parentIdExpr="parentId"
hasItemsExpr="hasItems"
rootValue=""
>
<RemoteOperations filtering={true} />
<Column dataField="name" />
<Column width={100} customizeText={customizeText} dataField="size" />
<Column width={150} dataField="createdDate" dataType="date" />
<Column width={150} dataField="modifiedDate" dataType="date" />
</TreeList>
);
export default App;
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
This feature requires client- and server-side configurations. To configure the client-side part, do the following:
-
Send an expanded node's ID to the server
For this, implement the CustomStore's load function. In this demo, we do it in the dataSource configuration object. -
Delegate filtering to the server
Set the remoteOperations.filtering property to true. -
Specify the data field that defines whether the node has children
Use the hasItemsExpr property to set this data field.
Server-side implementation is available in the ASP.NET Core and ASP.NET MVC versions of this demo under the TreeListDataController.cs
tab.
This demo uses a simple data bind technique that is useful for data display purposes only. When a user clicks a node, TreeList receives a JSON object from the server, which is based on the parentIds property value. This technique does not support the built-in data process operations in TreeList on the server.
If your project needs to process data, do one of the following instead:
- Implement a custom data source. See the Custom Data Source demo.
- Use the DevExtreme.AspNet.Data extension as shown in the Web API Service demo.