kor TürkçeGitHub

TreeField

Picks a node from a hierarchy.

kor/ui/TreeFieldSource

When to use

  • Use it for cost centers, categories and locations.

Examples

Cost center

Loading the example

<k:TreeField label="Cost center" leafOnly="true" items="{path: '/nodes', templateShareable: false}"><k:TreeItem key="{id}" parentKey="{up}" text="{text}"/></k:TreeField>

API

Properties

NameTypeDefaultDescription
selectedKeystringSelected key
labelstringLabel
placeholderstringPlaceholder
helpstringHelp text
errorstringError text
leafOnlybooleanfalseWhether only leaves can be chosen
showPathbooleantrueWhether the field shows the parent branches
requiredbooleanfalseWhether a value is required
enabledbooleantrueWhether the control is enabled

Aggregations

NameTypeDescription
itemsTreeItem[]A flat list. The tree is built from parentKey

Events

NameTypeDescription
changekey: stringThe selection changed

TreeItem

A tree option.

Properties

NameTypeDefaultDescription
keystringKey
parentKeystringKey of the parent
textstringText

Related

SelectFieldLookupField