Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions articles/components/tree-grid/data-binding.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@

The next section explains the [classname]`TreeData` and [classname]`TreeDataProvider` concepts in more detail, and how to use them to modify, sort, and filter hierarchical data.

[NOTE]
====
[since:com.vaadin:vaadin@V25.3]#The [methodname]`setItems()` and [methodname]`setTreeData()` shorthand methods are deprecated.# They create a [classname]`TreeDataProvider` with [enumname]`HierarchyFormat.NESTED` today, but will create one with [enumname]`HierarchyFormat.FLATTENED` starting from Vaadin 26. That affects Tree Grid methods whose behavior depends on the hierarchy format, such as [methodname]`scrollToIndex()`. To keep the current behavior, create the [classname]`TreeDataProvider` yourself with [enumname]`HierarchyFormat.NESTED` and set it with [methodname]`setDataProvider()`, as shown in the next section.

Check warning on line 66 in articles/components/tree-grid/data-binding.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Versions] Don't refer to a specific Vaadin version. Raw Output: {"message":"[Vaadin.Versions] Don't refer to a specific Vaadin version.","location":{"path":"articles/components/tree-grid/data-binding.adoc","range":{"start":{"line":66,"column":297},"end":{"line":66,"column":306}}},"severity":"WARNING","code":{"value":"Vaadin.Versions","url":"https://vaadin.com/docs/contributing/docs/styleguide#vaadin-versions"}}

Check warning on line 66 in articles/components/tree-grid/data-binding.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Will] Avoid using 'will'. Raw Output: {"message":"[Vaadin.Will] Avoid using 'will'.","location":{"path":"articles/components/tree-grid/data-binding.adoc","range":{"start":{"line":66,"column":224},"end":{"line":66,"column":228}}},"severity":"WARNING","code":{"value":"Vaadin.Will","url":"https://vaadin.com/docs/contributing/docs/styleguide#present-tense"}}
====


== Tree Data Provider

Expand Down Expand Up @@ -96,6 +101,8 @@
[NOTE]
====
Using the [enumname]`HierarchyFormat.FLATTENED` option with [classname]`TreeDataProvider` is recommended to ensure Tree Grid preserves its scroll position after the TreeData's hierarchy is modified. More details about hierarchy formats are provided later in this article in the <<#hierarchy-formats,Hierarchy Formats>> section.

[since:com.vaadin:vaadin@V25.3]#The single-argument [classname]`TreeDataProvider` constructor is deprecated# for the same reason as the shorthand methods above: it defaults to [enumname]`HierarchyFormat.NESTED` today, and to [enumname]`HierarchyFormat.FLATTENED` starting from Vaadin 26. Pass the format explicitly to state which one the application wants.

Check warning on line 105 in articles/components/tree-grid/data-binding.adoc

View workflow job for this annotation

GitHub Actions / lint

[vale] reported by reviewdog 🐶 [Vaadin.Versions] Don't refer to a specific Vaadin version. Raw Output: {"message":"[Vaadin.Versions] Don't refer to a specific Vaadin version.","location":{"path":"articles/components/tree-grid/data-binding.adoc","range":{"start":{"line":105,"column":278},"end":{"line":105,"column":287}}},"severity":"WARNING","code":{"value":"Vaadin.Versions","url":"https://vaadin.com/docs/contributing/docs/styleguide#vaadin-versions"}}
====

=== Adding Items
Expand Down
Loading