/** * DevExtreme (ui/tree_view.d.ts) * Version: 21.1.7 * Build date: Thu Aug 07 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { UserDefinedElement, DxElement, } from '../core/element'; import { DxPromise, } from '../core/utils/deferred'; import DataSource, { Options as DataSourceOptions, } from '../data/data_source'; import Store from '../data/abstract_store'; import { EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, } from '../events/index'; import { CollectionWidgetItem, } from './collection/ui.collection_widget.base'; import HierarchicalCollectionWidget, { HierarchicalCollectionWidgetOptions, } from './hierarchical_collection/ui.hierarchical_collection_widget'; import { SearchBoxMixinOptions, } from './widget/ui.search_box_mixin'; /** @public */ export type ContentReadyEvent = EventInfo; /** @public */ export type DisposingEvent = EventInfo; /** @public */ export type InitializedEvent = InitializedEventInfo; /** @public */ export type ItemClickEvent = NativeEventInfo & { readonly itemData?: any; readonly itemElement?: DxElement; readonly itemIndex?: number | any; readonly node?: Node; }; /** @public */ export type ItemCollapsedEvent = NativeEventInfo & { readonly itemData?: any; readonly itemElement?: DxElement; readonly itemIndex?: number; readonly node?: Node; }; /** @public */ export type ItemContextMenuEvent = NativeEventInfo & { readonly itemData?: any; readonly itemElement?: DxElement; readonly itemIndex?: number | any; readonly node?: Node; }; /** @public */ export type ItemExpandedEvent = NativeEventInfo & { readonly itemData?: any; readonly itemElement?: DxElement; readonly itemIndex?: number; readonly node?: Node; }; /** @public */ export type ItemHoldEvent = NativeEventInfo & { readonly itemData?: any; readonly itemElement?: DxElement; readonly itemIndex?: number; readonly node?: Node; }; /** @public */ export type ItemRenderedEvent = EventInfo & { readonly itemData?: any; readonly itemElement?: DxElement; readonly itemIndex?: number; readonly node?: Node; }; /** @public */ export type ItemSelectionChangedEvent = EventInfo & { readonly node?: Node; readonly itemElement?: DxElement; readonly itemData?: any; readonly itemIndex?: number; }; /** @public */ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; /** @public */ export type SelectAllValueChangedEvent = EventInfo & { readonly value?: boolean | undefined; }; /** @public */ export type SelectionChangedEvent = EventInfo; /** * @deprecated use Properties instead * @namespace DevExpress.ui */ export interface dxTreeViewOptions extends HierarchicalCollectionWidgetOptions, SearchBoxMixinOptions { /** * @docid * @default true * @public */ animationEnabled?: boolean; /** * @docid * @type_function_param1 parentNode:dxTreeViewNode * @type_function_return Promise|Array * @public */ createChildren?: ((parentNode: Node) => PromiseLike | Array); /** * @docid * @type string | Array | Store | DataSource | DataSourceOptions * @default null * @public */ dataSource?: string | Array | Store | DataSource | DataSourceOptions; /** * @docid * @type Enums.TreeViewDataStructure * @default 'tree' * @public */ dataStructure?: 'plain' | 'tree'; /** * @docid * @default false * @public */ expandAllEnabled?: boolean; /** * @docid * @type Enums.TreeViewExpandEvent * @default "dblclick" * @public */ expandEvent?: 'dblclick' | 'click'; /** * @docid * @default true * @public */ expandNodesRecursive?: boolean; /** * @docid * @default 'expanded' * @hidden false * @public */ expandedExpr?: string | Function; /** * @docid * @default 'hasItems' * @public */ hasItemsExpr?: string | Function; /** * @docid * @type Array * @public */ items?: Array; /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 event:event * @type_function_param1_field8 node:dxTreeViewNode * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemClick?: ((e: ItemClickEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:Number * @type_function_param1_field7 event:event * @type_function_param1_field8 node:dxTreeViewNode * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemCollapsed?: ((e: ItemCollapsedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number | object * @type_function_param1_field7 event:event * @type_function_param1_field8 node:dxTreeViewNode * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemContextMenu?: ((e: ItemContextMenuEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:Number * @type_function_param1_field7 event:event * @type_function_param1_field8 node:dxTreeViewNode * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemExpanded?: ((e: ItemExpandedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number * @type_function_param1_field7 event:event * @type_function_param1_field8 node:dxTreeViewNode * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemHold?: ((e: ItemHoldEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 itemData:object * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field6 itemIndex:number * @type_function_param1_field7 node:dxTreeViewNode * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onItemRendered?: ((e: ItemRenderedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 node:dxTreeViewNode * @type_function_param1_field5 itemElement:DxElement * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @type_function_param1_field6 itemData:object * @type_function_param1_field7 itemIndex:number * @action * @public */ onItemSelectionChanged?: ((e: ItemSelectionChangedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field4 value:boolean | undefined * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public */ onSelectAllValueChanged?: ((e: SelectAllValueChangedEvent) => void); /** * @docid * @default null * @type_function_param1 e:object * @type_function_param1_field1 component:dxTreeView * @type_function_param1_field2 element:DxElement * @type_function_param1_field3 model:any * @action * @public * @override */ onSelectionChanged?: ((e: SelectionChangedEvent) => void); /** * @docid * @default 'parentId' * @hidden false * @public */ parentIdExpr?: string | Function; /** * @docid * @default 0 * @public */ rootValue?: any; /** * @docid * @type Enums.ScrollDirection * @default "vertical" * @public */ scrollDirection?: 'both' | 'horizontal' | 'vertical'; /** * @docid * @default "Select All" * @public */ selectAllText?: string; /** * @docid * @default false * @public */ selectByClick?: boolean; /** * @docid * @default true * @public */ selectNodesRecursive?: boolean; /** * @docid * @type Enums.NavSelectionMode * @default "multiple" * @public */ selectionMode?: 'multiple' | 'single'; /** * @docid * @type Enums.TreeViewCheckBoxMode * @default 'none' * @public */ showCheckBoxesMode?: 'none' | 'normal' | 'selectAll'; /** * @docid * @default false * @public */ virtualModeEnabled?: boolean; /** * @docid * @default true * @default false &for(desktop except Mac) * @public */ useNativeScrolling?: boolean; } /** * @docid * @inherits HierarchicalCollectionWidget, SearchBoxMixin * @namespace DevExpress.ui * @public */ export default class dxTreeView extends HierarchicalCollectionWidget { constructor(element: UserDefinedElement, options?: dxTreeViewOptions) /** * @docid * @publicName collapseAll() * @public */ collapseAll(): void; /** * @docid * @publicName collapseItem(itemData) * @param1 itemData:Object * @return Promise * @public */ collapseItem(itemData: any): DxPromise; /** * @docid * @publicName collapseItem(itemElement) * @return Promise * @public */ collapseItem(itemElement: Element): DxPromise; /** * @docid * @publicName collapseItem(key) * @return Promise * @public */ collapseItem(key: any): DxPromise; /** * @docid * @publicName expandAll() * @public */ expandAll(): void; /** * @docid * @publicName expandItem(itemData) * @param1 itemData:Object * @return Promise * @public */ expandItem(itemData: any): DxPromise; /** * @docid * @publicName expandItem(itemElement) * @return Promise * @public */ expandItem(itemElement: Element): DxPromise; /** * @docid * @publicName expandItem(key) * @return Promise * @public */ expandItem(key: any): DxPromise; /** * @docid * @publicName getNodes() * @public * @return Array */ getNodes(): Array; /** * @docid * @publicName getSelectedNodes() * @public * @return Array */ getSelectedNodes(): Array; /** * @docid * @publicName getSelectedNodeKeys() * @public */ getSelectedNodeKeys(): Array; /** * @docid * @publicName selectAll() * @public */ selectAll(): void; /** * @docid * @publicName selectItem(itemData) * @param1 itemData:Object * @public */ selectItem(itemData: any): boolean; /** * @docid * @publicName selectItem(itemElement) * @public */ selectItem(itemElement: Element): boolean; /** * @docid * @publicName selectItem(key) * @public */ selectItem(key: any): boolean; /** * @docid * @publicName unselectAll() * @public */ unselectAll(): void; /** * @docid * @publicName unselectItem(itemData) * @param1 itemData:Object * @public */ unselectItem(itemData: any): boolean; /** * @docid * @publicName unselectItem(itemElement) * @public */ unselectItem(itemElement: Element): boolean; /** * @docid * @publicName unselectItem(key) * @public */ unselectItem(key: any): boolean; /** * @docid * @publicName updateDimensions() * @return Promise * @public */ updateDimensions(): DxPromise; /** * @docid * @publicName scrollToItem(itemData) * @param1 itemData:Object * @return Promise * @public */ scrollToItem(itemData: any): DxPromise; /** * @docid * @publicName scrollToItem(itemElement) * @return Promise * @public */ scrollToItem(itemElement: Element): DxPromise; /** * @docid * @publicName scrollToItem(key) * @return Promise * @public */ scrollToItem(key: any): DxPromise; } /** * @public * @namespace DevExpress.ui.dxTreeView */ export type Item = dxTreeViewItem; /** * @deprecated Use Item instead * @namespace DevExpress.ui */ export interface dxTreeViewItem extends CollectionWidgetItem { /** * @docid * @default false * @public */ expanded?: boolean; /** * @docid * @default undefined * @public */ hasItems?: boolean; /** * @docid * @public */ icon?: string; /** * @docid * @public * @type Array */ items?: Array; /** * @docid * @default undefined * @public */ id?: number | string; /** * @docid * @default undefined * @public */ parentId?: number | string; /** * @docid * @default false * @public */ selected?: boolean; } /** @public */ export type Node = dxTreeViewNode; /** * @docid * @deprecated {ui/tree_view.Node} * @type object * @namespace DevExpress.ui */ export interface dxTreeViewNode { /** * @docid * @public */ children?: Array; /** * @docid * @public */ disabled?: boolean; /** * @docid * @public */ expanded?: boolean; /** * @docid * @public */ itemData?: any; /** * @docid * @public */ key?: any; /** * @docid * @public */ parent?: dxTreeViewNode; /** * @docid * @public */ selected?: boolean; /** * @docid * @public */ text?: string; } /** @public */ export type Properties = dxTreeViewOptions; /** @deprecated use Properties instead */ export type Options = dxTreeViewOptions; /** @deprecated use Properties instead */ export type IOptions = dxTreeViewOptions;