-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
scope: tree viewChanges related to the tree view. This includes TreeView, TreeItem.Changes 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.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.
Description
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
- Item creation: [tree-view] Add API support for inline row addition in Tree components #19751
- Item updates ✅
setIsItemDisabled
,updateItemLabel
(but right now we never update the actual label because we don't know how to do it when the user uses custom properties. We can wait for users feedback here) - Removing items: need to expose a method
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
Labels
scope: tree viewChanges related to the tree view. This includes TreeView, TreeItem.Changes 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.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.