Skip to main content

ItemInstance <T>

Hierarchy

  • ItemInstanceType<T>
    • ItemInstance

Index

Properties

canRename

canRename: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

collapse

collapse: () => void

Type declaration

    • (): void
    • Returns void

collapseAll

collapseAll: () => void

Type declaration

    • (): void
    • Returns void

customHandler

customHandler: (param1: number, param2: number) => void

Type declaration

    • (param1: number, param2: number): void
    • Parameters

      • param1: number
      • param2: number

      Returns void

deselect

deselect: () => void

Type declaration

    • (): void
    • Returns void

equals

equals: (other?: null | ItemInstance<any>) => boolean

Type declaration

expand

expand: () => void

Type declaration

    • (): void
    • Returns void

expandAll

expandAll: (cancelToken?: { current: boolean }) => Promise<void>

Type declaration

    • (cancelToken?: { current: boolean }): Promise<void>
    • Parameters

      • optionalcancelToken: { current: boolean }

      Returns Promise<void>

getCheckboxProps

getCheckboxProps: () => Record<string, any>

Type declaration

    • (): Record<string, any>
    • Returns Record<string, any>

getCheckedState

getCheckedState: () => CheckedState

Type declaration

getChildren

getChildren: () => ItemInstance<T>[]

Type declaration

getElement

getElement: () => undefined | null | HTMLElement

Type declaration

    • (): undefined | null | HTMLElement
    • Returns undefined | null | HTMLElement

getId

getId: () => string

Type declaration

    • (): string
    • Returns string

getIndexInParent

getIndexInParent: () => number

Type declaration

    • (): number
    • Returns number

getItemAbove

getItemAbove: () => undefined | ItemInstance<T>

Type declaration

getItemBelow

getItemBelow: () => undefined | ItemInstance<T>

Type declaration

getItemData

getItemData: () => T

Type declaration

    • (): T
    • Returns T

getItemMeta

getItemMeta: () => ItemMeta

Type declaration

getItemName

getItemName: () => string

Type declaration

    • (): string
    • Returns string

getKey

getKey: () => string

Type declaration

    • (): string
    • Returns string

getParent

getParent: () => undefined | ItemInstance<T>

Type declaration

getProps

getProps: () => Record<string, any>

Type declaration

    • (): Record<string, any>
    • Returns Record<string, any>

getRenameInputProps

getRenameInputProps: () => any

Type declaration

    • (): any
    • Returns any

getTree

getTree: () => TreeInstance<T>

Type declaration

invalidateChildrenIds

invalidateChildrenIds: (optimistic?: boolean) => Promise<void>

Invalidate fetched children ids for item, and triggers a refetch and subsequent rerender if the item is visible


Type declaration

    • (optimistic?: boolean): Promise<void>
    • Parameters

      • optionaloptimistic: boolean

        If true, the item will not trigger a state update on loadingItemChildrens, and the tree will continue to display the old data until the new data has loaded.

      Returns Promise<void>

invalidateItemData

invalidateItemData: (optimistic?: boolean) => Promise<void>

Invalidate fetched data for item, and triggers a refetch and subsequent rerender if the item is visible


Type declaration

    • (optimistic?: boolean): Promise<void>
    • Parameters

      • optionaloptimistic: boolean

        If true, the item will not trigger a state update on loadingItemData, and the tree will continue to display the old data until the new data has loaded.

      Returns Promise<void>

isDescendentOf

isDescendentOf: (parentId: string) => boolean

Type declaration

    • (parentId: string): boolean
    • Parameters

      • parentId: string

      Returns boolean

isDragTarget

isDragTarget: () => boolean

Checks if the user is dragging in a way which makes this the new parent of the dragged items, either by dragging on top of this item, or by dragging inbetween children of this item. See @{isUnorderedDragTarget} if the latter is undesirable.


Type declaration

    • (): boolean
    • Returns boolean

isDragTargetAbove

isDragTargetAbove: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isDragTargetBelow

isDragTargetBelow: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isDraggingOver

isDraggingOver: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isExpanded

isExpanded: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isFocused

isFocused: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isFolder

isFolder: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isLoading

isLoading: () => boolean & () => boolean

isLoadingCheckPropagation

isLoadingCheckPropagation: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isMatchingSearch

isMatchingSearch: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isRenaming

isRenaming: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isSelected

isSelected: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

isUnorderedDragTarget

isUnorderedDragTarget: () => boolean

As opposed to @{isDragTarget}, this will not be true if the target is inbetween children of this item. This returns only true if the user is dragging directly on top of this item.


Type declaration

    • (): boolean
    • Returns boolean

primaryAction

primaryAction: () => void

Type declaration

    • (): void
    • Returns void

registerElement

registerElement: (element: null | HTMLElement) => void

Type declaration

    • (element: null | HTMLElement): void
    • Parameters

      • element: null | HTMLElement

      Returns void

scrollTo

scrollTo: (scrollIntoViewArg?: boolean | ScrollIntoViewOptions) => Promise<void>

Type declaration

    • (scrollIntoViewArg?: boolean | ScrollIntoViewOptions): Promise<void>
    • Parameters

      • optionalscrollIntoViewArg: boolean | ScrollIntoViewOptions

      Returns Promise<void>

select

select: () => void

Type declaration

    • (): void
    • Returns void

selectUpTo

selectUpTo: (ctrl: boolean) => void

Type declaration

    • (ctrl: boolean): void
    • Parameters

      • ctrl: boolean

      Returns void

setChecked

setChecked: () => Promise<void>

Will recursively load descendants if propagateCheckedState=true and async data loader is used. If not, this will return immediately.


Type declaration

    • (): Promise<void>
    • Returns Promise<void>

setFocused

setFocused: () => void

Type declaration

    • (): void
    • Returns void

setUnchecked

setUnchecked: () => Promise<void>

Will recursively load descendants if propagateCheckedState=true and async data loader is used. If not, this will return immediately.


Type declaration

    • (): Promise<void>
    • Returns Promise<void>

startRenaming

startRenaming: () => void

Type declaration

    • (): void
    • Returns void

toggleCheckedState

toggleCheckedState: () => Promise<void>

Will recursively load descendants if propagateCheckedState=true and async data loader is used. If not, this will return immediately.


Type declaration

    • (): Promise<void>
    • Returns Promise<void>

toggleSelect

toggleSelect: () => void

Type declaration

    • (): void
    • Returns void

updateCachedChildrenIds

updateCachedChildrenIds: (childrenIds: string[]) => void

Type declaration

    • (childrenIds: string[]): void
    • Parameters

      • childrenIds: string[]

      Returns void

updateCachedData

updateCachedData: (data: undefined | T) => void

Set to undefined to clear cache without triggering automatic refetch. Use

@invalidateItemData

to clear and triggering refetch.


Type declaration

    • (data: undefined | T): void
    • Parameters

      • data: undefined | T

      Returns void