New to Kendo UI for Angular? Start a free 30-day trial

Persisting the Expanded State

The DropDownTree enables you to define and persist the expanded state of its nodes when the popup TreeView is re-rendered.

Manual Setup

The DropDownTree exposes the following options to control the expand state:

  • isNodeExpanded ((node: any) => boolean)Determines if a given node is expanded.
  • nodeCollapse (EventEmitter<any>)Fired when a given node is about to be collapsed.
  • nodeExpand (EventEmitter<any>)Fired when a given node is about to be expanded.

The following example demonstrates how to manually track and control the

Example
View Source
Edit In Stackblitz  
Change Theme:

Using the Built-In Directive

By default, the built-in kendoDropDownTreeExpandable directive persists the expanded items based on their hierarchical index.

Example
View Source
Edit In Stackblitz  
Change Theme: