Skip to content

Latest commit

 

History

History
114 lines (58 loc) · 2.14 KB

TreeGridMixin.md

File metadata and controls

114 lines (58 loc) · 2.14 KB

@serenity-is/corelib / TreeGridMixin

Class: TreeGridMixin<TItem>

A mixin that can be applied to a DataGrid for tree functionality

Type Parameters

TItem

Constructors

new TreeGridMixin()

new TreeGridMixin<TItem>(options): TreeGridMixin<TItem>

Parameters

options

TreeGridMixinOptions<TItem>

Returns

TreeGridMixin<TItem>

Defined in

src/ui/datagrid/treegridmixin.ts:14

Methods

collapseAll()

collapseAll(): void

Returns

void

Defined in

src/ui/datagrid/treegridmixin.ts:66


expandAll()

expandAll(): void

Returns

void

Defined in

src/ui/datagrid/treegridmixin.ts:71


toggleAll()

toggleAll(): void

Expands / collapses all rows in a grid automatically

Returns

void

Defined in

src/ui/datagrid/treegridmixin.ts:59


applyTreeOrdering()

static applyTreeOrdering<TItem>(items, getId, getParentId): TItem[]

Reorders a set of items so that parents comes before their children. This method is required for proper tree ordering, as it is not so easy to perform with SQL.

Type Parameters

TItem

Parameters

items

TItem[]

list of items to be ordered

getId

(item) => any

a delegate to get ID of a record (must return same ID with grid identity field)

getParentId

(item) => any

a delegate to get parent ID of a record

Returns

TItem[]

Defined in

src/ui/datagrid/treegridmixin.ts:83