Skip to content

[tree view] Allow to add, update and delete items #19841

@noraleonte

Description

@noraleonte

Follow-up on #19751

Explore a way to create/update/delete items in the tree view and optimize the behavior for all the existing features - lazy loading included.

Part 1 - expose API methods to add / update / remove items

Part 2 - update the data source to allow users to register the changes in the Tree View

export type DataSource<R extends {}> = {
  getChildrenCount: (item: R) => number;
  getTreeItems: (parentId?: TreeViewItemId) => Promise<R[]>;
  updateTreeItems: (UpdateTreeItemsParameters) => Promise<void>;
};

interface UpdateTreeItemsParameters {
  added: R[];
  updated: R[];
  deleted: TreeViewItemId[];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: tree viewChanges related to the tree view. This includes TreeView, TreeItem.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions