The arguments for the TreeView constructor.

interface TreeViewArgs {
    alignItems?: string;
    allowDrag?: boolean;
    allowRenaming?: boolean;
    allowReordering?: boolean;
    binding?: BindingBase;
    children?: ReactNode;
    class?: string | string[];
    dom?: string | HTMLElement;
    dragScrollElement?: HTMLElement;
    enabled?: boolean;
    error?: boolean;
    filter?: string;
    flex?: boolean;
    flexBasis?: string;
    flexDirection?: string;
    flexGrow?: string;
    flexShrink?: string;
    flexWrap?: string;
    grid?: boolean;
    height?: number;
    hidden?: boolean;
    id?: string;
    ignoreParent?: boolean;
    isRoot?: boolean;
    link?: {
        observer: Observer | Observer[];
        path: string | string[];
    };
    onChange?: ((value) => void);
    onClick?: (() => void);
    onContextMenu?: ((evt, item) => void);
    onRemove?: (() => void);
    onReparent?: any;
    onResize?: (() => void);
    parent?: Element;
    readOnly?: boolean;
    resizable?: string;
    resizeMax?: number;
    resizeMin?: number;
    scrollable?: boolean;
    style?: string;
    tabIndex?: number;
    width?: number;
}

Hierarchy (view full)

Properties

alignItems?: string

Sets the Container's align items property.

allowDrag?: boolean

Whether dragging a TreeViewItem is allowed. Defaults to true.

allowRenaming?: boolean

Whether renaming TreeViewItems is allowed by double clicking on them. Defaults to false.

allowReordering?: boolean

Whether reordering TreeViewItems is allowed. Defaults to true.

binding?: BindingBase

A binding to use with this Element.

children?: ReactNode

The children of the current component.

class?: string | string[]

The class attribute of this Element's HTMLElement.

dom?: string | HTMLElement

The HTMLElement to create this Element with. If not provided this Element will create one.

dragScrollElement?: HTMLElement

The element to scroll on drag. Defaults to this TreeView's DOM element.

enabled?: boolean

Sets whether it is possible to interact with this Element and its children.

error?: boolean

Sets whether the Element is in an error state.

filter?: string

A filter that searches TreeViewItems and only shows the ones that are relevant to the filter.

flex?: boolean

Sets whether the element uses flex layout.

flexBasis?: string

Sets the element's flexBasis CSS property.

flexDirection?: string

Sets the element's flexDirection CSS property.

flexGrow?: string

Sets the element's flexGrow CSS property.

flexShrink?: string

Sets the element's flexShrink CSS property.

flexWrap?: string

Sets the element's flexWrap CSS property.

grid?: boolean

Sets whether the Container supports the grid layout.

height?: number

Sets the initial height of the Element.

hidden?: boolean

Sets whether this Element is hidden. Defaults to false.

id?: string

The id attribute of this Element's HTMLElement.

ignoreParent?: boolean

If true, this Element will ignore its parent's enabled value when determining whether this element is enabled. Defaults to false.

isRoot?: boolean

Sets whether this Element is at the root of the hierarchy.

link?: {
    observer: Observer | Observer[];
    path: string | string[];
}

Links the observer attribute at the path location in the given observer to this Element.

Type declaration

  • observer: Observer | Observer[]
  • path: string | string[]
onChange?: ((value) => void)

If provided and the Element is changeable, this function will be called each time the element value is changed.

Type declaration

    • (value): void
    • Parameters

      • value: any

      Returns void

onClick?: (() => void)

If provided and the Element is clickable, this function will be called each time the element is clicked.

Type declaration

    • (): void
    • Returns void

onContextMenu?: ((evt, item) => void)

A function to be called when we right click on a TreeViewItem.

Type declaration

onRemove?: (() => void)

If provided and the Element is removable, this function will be called each time the element is removed.

Type declaration

    • (): void
    • Returns void

onReparent?: any

A function to be called when we try to reparent tree items. If a function is provided then the tree items will not be reparented by the TreeView but instead will rely on the function to reparent them as it sees fit.

onResize?: (() => void)

Called when the Container has been resized.

Type declaration

    • (): void
    • Returns void

parent?: Element

Sets the parent Element.

readOnly?: boolean

Whether this Element is read only or not. Defaults to false.

resizable?: string

Sets whether the Container is resizable and where the resize handle is located. Can be one of 'top', 'bottom', 'right', 'left'. Defaults to null which disables resizing.

resizeMax?: number

Sets the maximum size the Container can take when resized in pixels.

resizeMin?: number

Sets the minimum size the Container can take when resized in pixels.

scrollable?: boolean

Sets whether the Container should be scrollable.

style?: string

Sets an initial value for Element.dom.style.

tabIndex?: number

Sets the tabIndex of the Element.

width?: number

Sets the initial width of the Element.