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:1625

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:1757


captionLabel

get captionLabel(): HTMLElement

Caption label

Returns

HTMLElement

Source

src/widgets.ts:1646


checkBox

get checkBox(): null | HTMLElement

Check box element

Returns

null | HTMLElement

Source

src/widgets.ts:1649


checked

get checked(): boolean

Returns true if checked

set checked(checked): void

Parameters

ParameterType
checkedboolean

Returns

boolean

Source

src/widgets.ts:1652


children

get children(): TreeViewNode<any>[]

Gets the node's children

Returns

TreeViewNode<any>[]

Source

src/widgets.ts:1736


currentItem

get currentItem(): TreeViewNode<any>

Currently selected node.

set currentItem(node): void

Parameters

ParameterType
nodeTreeViewNode<any>

Returns

TreeViewNode<any>

Source

src/widgets.ts:1761


expanded

get expanded(): boolean

Controls expanded state.

set expanded(isExpanded): void

Parameters

ParameterType
isExpandedboolean

Returns

boolean

Source

src/widgets.ts:1753


icon

get icon(): Element

Node icon

set icon(value): void

Parameters

ParameterType
valueElement

Returns

Element

Source

src/widgets.ts:1660


items

get items(): TreeViewNode<any>[]

Gets all node items

Returns

TreeViewNode<any>[]

Source

src/widgets.ts:1731


onChildNodeExpandedChanged

get onChildNodeExpandedChanged(): Observable <TreeViewGroup>

Returns

Observable <TreeViewGroup>

Source

src/widgets.ts:1790


onChildNodeExpanding

get onChildNodeExpanding(): Observable <TreeViewGroup>

Returns

Observable <TreeViewGroup>

Source

src/widgets.ts:1791


onNodeAdded

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1788


onNodeCheckBoxToggled

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1789


onNodeContextMenu

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1793


onNodeEnter

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1797


onNodeExpanding

get onNodeExpanding(): Observable <TreeViewGroup>

Returns

Observable <TreeViewGroup>

Source

src/widgets.ts:1787


onNodeMouseEnter

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1795


onNodeMouseLeave

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1796


onSelected

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

Occurs when the selected node is changed.

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1677


onSelectedNodeChanged

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

Returns

Observable <TreeViewNode<any>>

Source

src/widgets.ts:1794


parent

get parent(): TreeViewNode<any>

Node's parent

Returns

TreeViewNode<any>

Source

src/widgets.ts:1643


root

get root(): HTMLElement

Visual root

Returns

HTMLElement

Source

src/widgets.ts:1630


rootNode

get rootNode(): TreeViewGroup

Top-most node.

Returns

TreeViewGroup

Source

src/widgets.ts:1635


tag

get tag(): any

Auxiliary information associated with the node.

set tag(t): void

Parameters

ParameterType
tany

Returns

any

Source

src/widgets.ts:1664


text

get text(): string

Node text

set text(value): void

Parameters

ParameterType
valuestring

Returns

string

Source

src/widgets.ts:1656


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:1668

Methods

addItems()

addItems(items): TreeViewNode<any>

Adds new items to group

Parameters

ParameterType
itemsany[]

Returns

TreeViewNode<any>

Source

src/widgets.ts:1780


enableCheckBox()

enableCheckBox(checked): void

Enables checkbox

Parameters

ParameterTypeDefault value
checkedbooleanfalse

Returns

void

Inherited from

TreeViewNode . enableCheckBox

Source

src/widgets.ts:1672


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:1770


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:1765


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:1775


loadSources()

loadSources(source): Promise<void>

Parameters

ParameterType
sourceHttpDataSource<any>

Returns

Promise<void>

Source

src/widgets.ts:1799


remove()

remove(): void

Removes the node and its children from the parent

Returns

void

Inherited from

TreeViewNode . remove

Source

src/widgets.ts:1680


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:1741


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:1691


tree()

static tree(): TreeViewGroup

Creates new tree

Returns

TreeViewGroup

Source

src/widgets.ts:1687