expanded(index, [expanded], [recursive])
Class: Tree.
Description:
Sets or gets the expand state of a specified item that has children. Items without children cannot be expanded. When setting expanded argument and index doesn't point to an item then just nothing will happen.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
Array.<number> |
Index path of the item in question |
|
|
|
boolean |
Pass |
|
|
|
boolean |
false |
Whether the specified |
Returns:
If expanded argument is passed, then this Tree component is returned; otherwise current expand state is returned, or undefined if specified index in not valid.
Type: boolean | undefined | Tree
Examples:
Expand root node:
tree.expended([0], true);
Collapse item at specified index:
tree.expended([0, 2], false);
Check if item at specified index is expanded:
let expanded = tree.expended([0, 2]);
