TreeGridElement
Playwright element wrapper for Vaadin Tree Grid, extendingGridElement with tree-specific APIs for expanding/collapsing rows, querying hierarchy levels, and performing bulk operations by level.
Component Tag
vaadin-grid (same as Grid, with tree-specific features)
Inheritance
ExtendsGridElement - all Grid methods are available plus tree-specific methods.
Constructor
Locator
required
Playwright locator for the
<vaadin-grid> element backed by a TreeGridStatic Factory Methods
get
Get the first tree grid on the page or within a parent locator.Page
Playwright page
Locator
Parent locator to search within
getById
Get a tree grid by its id attribute.Page
Playwright page
String
Element id
Tree Row Query Methods
findTreeRow
Find the tree row at the given index, returning a TreeRowElement.int
0-based row index
TreeRowElement that exposes tree-specific state and actions.
isRowExpanded
Whether the row at the given index is expanded.int
0-based row index
isRowCollapsed
Whether the row is collapsed (has children but is not expanded).int
0-based row index
isRowLeaf
Whether the row is a leaf node (has no children).int
0-based row index
getRowLevel
Get the hierarchy level of the row (0-based; root items are level 0).int
0-based row index
getExpandedRowCount
Get the number of currently visible expanded rows.Expand/Collapse Methods
expandRow
Expand the row at the given index. Does nothing if already expanded or is a leaf.int
0-based row index
collapseRow
Collapse the row at the given index. Does nothing if already collapsed or is a leaf.int
0-based row index
toggleRow
Toggle the expand/collapse state. Does nothing if the row is a leaf.int
0-based row index
Inner Class: TreeRowElement
ExtendsGridElement.RowElement with tree-specific state queries and actions.
Methods
Locator getTreeToggleLocator()- Get the tree toggle locatorboolean isExpanded()- Whether the row is expandedboolean isLeaf()- Whether the row is a leafboolean isCollapsed()- Whether the row is collapsedint getLevel()- Get the hierarchy levelvoid expand()- Expand the rowvoid collapse()- Collapse the rowvoid toggle()- Toggle expand/collapse state