Skip to content

Commit 15ea754

Browse files
committed
docs: explain tree grid data providers
1 parent 1e37cb3 commit 15ea754

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Data Providers
3+
page-title: Using data providers with the Vaadin Tree Grid component
4+
order: 30
5+
---
6+
7+
= Data Providers (Flow)
8+
9+
Tree Grid allows you to connect to different types of data sources through hierarchical data providers. It comes with a simple in-memory `TreeData` structure along with `TreeDataProvider`, which provide an easy way to build and manage hierarchical data directly in memory, and it also supports custom data providers for more advanced use cases.
10+
11+
From a technical perspective, a hierarchical data provider is a class that implements the [classname]`HierarchicalDataProvider` interface, and serves as an abstraction layer between the component and the data source. When the component needs to load data, it calls the data provider's `fetchChildren` and `getChildCount` methods with a `HierarchicalQuery` object that contains information about the requested range, the parent item whose children should be fetched, and other parameters. The data provider is responsible for querying the data source and returning the requested range in a format that the component can understand and display.
12+
13+
Tree Grid supports data providers that return hierarchical data in one of the two formats: `HierarchyFormat.NESTED` and `HierarchyFormat.FLATTENED`. Each format has its own advantages and use cases, so you can choose the one that better fits your data structure and application requirements.
14+
15+
== HierarchyFormat.NESTED
16+
17+
== HierarchyFormat.FLATTENED

0 commit comments

Comments
 (0)