com.vaadin.flow.component.treegrid.

Class TreeGrid<T>

Type Parameters:

T - the grid bean type

All Implemented Interfaces:

AttachNotifier, BlurNotifier<Grid<T>>, DetachNotifier, Focusable<Grid<T>>, FocusNotifier<Grid<T>>, HasElement, HasEnabled, HasSize, HasStyle, HasTheme, SortEvent.SortNotifier<Grid<T>,GridSortOrder<T>>, HasDataGenerators<T>, HasDataView<T,Void,GridDataView<T>>, HasLazyDataView<T,Void,GridLazyDataView<T>>, HasListDataView<T,GridListDataView<T>>, HasHierarchicalDataProvider<T>, Serializable

@JsModule("@vaadin/grid/src/vaadin-grid-tree-toggle.js") public class TreeGrid<T> extends Grid<T> implements HasHierarchicalDataProvider<T>

Tree Grid is a component for displaying hierarchical tabular data grouped into expandable and collapsible nodes. Tree Grid is an extension of the Grid component and all Grid?s features are available in Tree Grid as well.

Author:

Vaadin Ltd

See Also:

  • Constructor Details

    • TreeGrid

      public TreeGrid()

      Creates a new TreeGrid without support for creating columns based on property names. Use an alternative constructor, such as TreeGrid(Class), to create a TreeGrid that automatically sets up columns based on the type of presented data.

    • TreeGrid

      protected TreeGrid(int pageSize, Grid.DataCommunicatorBuilder<T,TreeGridArrayUpdater> dataCommunicatorBuilder)

      Creates a new TreeGrid without support for creating columns based on property names. Use an alternative constructor, such as TreeGrid(Class), to create a TreeGrid that automatically sets up columns based on the type of presented data.

      Parameters:

      pageSize - the page size. Must be greater than zero.

      dataCommunicatorBuilder - Builder for DataCommunicator implementation this Grid uses to handle all data communication.

    • TreeGrid

      public TreeGrid(Class<T> beanType)

      Creates a new TreeGrid with an initial set of columns for each of the bean's properties. The property-values of the bean will be converted to Strings. Full names of the properties will be used as the column keys and the property captions will be used as the column headers.

      Parameters:

      beanType - the bean type to use, not null

    • TreeGrid

      public TreeGrid(Class<T> beanType, boolean autoCreateColumns)

      Creates a new TreeGrid with an initial set of columns for each of the bean's properties. The property-values of the bean will be converted to Strings. Full names of the properties will be used as the column keys and the property captions will be used as the column headers.

      When autoCreateColumns is true, only the direct properties of the bean are included, and they will be in alphabetical order. Use Grid.setColumns(String...) to define which properties to include and in which order. You can also add a column for an individual property with Grid.addColumn(String). Both of these methods support also sub-properties with dot-notation, e.g. "property.nestedProperty".

      Parameters:

      beanType - the bean type to use, not null

      autoCreateColumns - when true, columns are created automatically for the properties of the beanType

    • TreeGrid

      protected TreeGrid(Class<T> beanType, Grid.DataCommunicatorBuilder<T,TreeGridArrayUpdater> dataCommunicatorBuilder)

      Creates a new TreeGrid with an initial set of columns for each of the bean's properties. The property-values of the bean will be converted to Strings. Full names of the properties will be used as the column keys and the property captions will be used as the column headers.

      Parameters:

      beanType - the bean type to use, not null

      dataCommunicatorBuilder - Builder for DataCommunicator implementation this Grid uses to handle all data communication.

    • TreeGrid

      public TreeGrid(HierarchicalDataProvider<T,?> dataProvider)

      Creates a new TreeGrid using the given HierarchicalDataProvider, without support for creating columns based on property names. Use an alternative constructor, such as TreeGrid(Class), to create a TreeGrid that automatically sets up columns based on the type of presented data.

      Parameters:

      dataProvider - the data provider, not null

  • Method Details