Skip to main content

TreeViewGroup

Tree view node. Sample: https://public.datagrok.ai/js/samples/ui/tree-view

Extends

Constructors

new TreeViewGroup()

new TreeViewGroup(dart): TreeViewGroup

Parameters

ParameterType
dartany

Returns

TreeViewGroup

Inherited from

TreeViewNode . constructor

Constructs

from the Dart object

Source

src/widgets.ts:1624

Properties

PropertyTypeInherited from
dartanyTreeViewNode.dart

Accessors

autoCheckChildren

get autoCheckChildren(): boolean

Indicates whether check or uncheck is applied to a node only or to all node's children

set autoCheckChildren(auto): void

Parameters

ParameterType
autoboolean

Returns

boolean

Source

src/widgets.ts:1756


captionLabel

get captionLabel(): HTMLElement

Caption label

Returns

HTMLElement

Source

src/widgets.ts:1645


checkBox

get checkBox(): null | HTMLElement

Check box element

Returns

null | HTMLElement

Source

src/widgets.ts:1648


checked

get checked(): boolean

Returns true if checked

set checked(checked): void

Parameters

ParameterType
checkedboolean

Returns

boolean

Source

src/widgets.ts:1651


children

get children(): TreeViewNode<any>[]

Gets the node's children

Returns

TreeViewNode<any>[]

Source

src/widgets.ts:1735


currentItem

get currentItem(): TreeViewNode<any>

Currently selected node.

set currentItem(node): void

Parameters

ParameterType
nodeTreeViewNode<any>

Returns

TreeViewNode<any>

Source

src/widgets.ts:1760


expanded

get expanded(): boolean

Controls expanded state.

set expanded(isExpanded): void

Parameters

ParameterType
isExpandedboolean

Returns

boolean

Source

src/widgets.ts:1752


icon

get icon(): Element

Node icon

set icon(value): void

Parameters

ParameterType
valueElement

Returns

Element

Source

src/widgets.ts:1659


items

get items(): TreeViewNode<any>[]

Gets all node items

Returns

TreeViewNode<any>[]

Source

src/widgets.ts:1730


onChildNodeExpandedChanged

get onChildNodeExpandedChanged(): Observable <TreeViewGroup>

Returns

Observable <TreeViewGroup>

Source

src/widgets.ts:1789


onChildNodeExpanding

get onChildNodeExpanding(): Observable <TreeViewGroup>

Returns

Observable <TreeViewGroup>

Source

src/widgets.ts:1790


onNodeAdded

get onNodeAdded(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1787


onNodeCheckBoxToggled

get onNodeCheckBoxToggled(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1788


onNodeContextMenu

get onNodeContextMenu(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1792


onNodeEnter

get onNodeEnter(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1796


onNodeExpanding

get onNodeExpanding(): Observable <TreeViewGroup>

Returns

Observable <TreeViewGroup>

Source

src/widgets.ts:1786


onNodeMouseEnter

get onNodeMouseEnter(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1794


onNodeMouseLeave

get onNodeMouseLeave(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1795


onSelected

get onSelected(): Observable <TreeViewNode<any>>

Occurs when the selected node is changed.

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1676


onSelectedNodeChanged

get onSelectedNodeChanged(): Observable <TreeViewNode<any>>

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1793


parent

get parent(): TreeViewNode<any>

Node's parent

Returns

TreeViewNode<any>

Source

src/widgets.ts:1642


root

get root(): HTMLElement

Visual root

Returns

HTMLElement

Source

src/widgets.ts:1629


rootNode

get rootNode(): TreeViewGroup

Top-most node.

Returns

TreeViewGroup

Source

src/widgets.ts:1634


tag

get tag(): any

Auxiliary information associated with the node.

set tag(t): void

Parameters

ParameterType
tany

Returns

any

Source

src/widgets.ts:1663


text

get text(): string

Node text

set text(value): void

Parameters

ParameterType
valuestring

Returns

string

Source

src/widgets.ts:1655


value

get value(): T

Node value. Normally, when you click on the node, the context panel shows this object.

set value(v): void

Parameters

ParameterType
vT

Returns

T

Source

src/widgets.ts:1667

Methods

addItems()

addItems(items): TreeViewNode<any>

Adds new items to group

Parameters

ParameterType
itemsany[]

Returns

TreeViewNode<any>

Source

src/widgets.ts:1779


enableCheckBox()

enableCheckBox(checked): void

Enables checkbox

Parameters

ParameterTypeDefault value
checkedbooleanfalse

Returns

void

Inherited from

TreeViewNode . enableCheckBox

Source

src/widgets.ts:1671


getOrCreateGroup()

getOrCreateGroup(text, value, expanded): TreeViewGroup

Returns existing, or creates a new node group

Parameters

ParameterTypeDefault value
textstringundefined
valuenull | objectnull
expandedbooleantrue

Returns

TreeViewGroup

Source

src/widgets.ts:1769


group()

group(text, value, expanded, index): TreeViewGroup

Adds new group and returns it

Parameters

ParameterTypeDefault value
textstring | Elementundefined
valuenull | objectnull
expandedbooleantrue
indexnull | numbernull

Returns

TreeViewGroup

Source

src/widgets.ts:1764


item()

item(text, value): TreeViewNode<any>

Adds new item to group

Parameters

ParameterTypeDefault value
textstring | Elementundefined
valuenull | objectnull

Returns

TreeViewNode<any>

Source

src/widgets.ts:1774


loadSources()

loadSources(source): Promise<void>

Parameters

ParameterType
sourceHttpDataSource<any>

Returns

Promise<void>

Source

src/widgets.ts:1798


remove()

remove(): void

Removes the node and its children from the parent

Returns

void

Inherited from

TreeViewNode . remove

Source

src/widgets.ts:1679


removeChildrenWhere()

removeChildrenWhere(predicate): void

Removes all children (going down recursively) that satisfy the predicate

Parameters

ParameterType
predicate(node) => boolean

Returns

void

Source

src/widgets.ts:1740


fromItemCategories()

static fromItemCategories(items, props, options?): TreeViewGroup

Parameters

ParameterType
itemsany[]
propsstring[]
options?object
options.itemToElement?(item) => Element
options.itemToString?(item) => string
options.itemToValue?(item) => any
options.removeEmpty?boolean

Returns

TreeViewGroup

Source

src/widgets.ts:1690


tree()

static tree(): TreeViewGroup

Creates new tree

Returns

TreeViewGroup

Source

src/widgets.ts:1686