Closed Nishchit14 closed 1 year ago
In the update call, can you try to change the emit call to
this.emitter.emit(ETreeEventTypes.itemChanged, ['root', item.id]);
So emitting an update for the item that is changed, not its parent. Also I'm not sure you need to notify RCT of the update of the root item.
It works now, I misunderstood the itemChanged
event. Thank you @lukasbach
Is your feature request related to a problem? Please describe. I have created a collection of Messages shown in the below screenshot. Where the item node holds
Title
andSub Title
. The functionality is like if Someone will change the title/subtitle from the team then collaboratively it would reflect in every team member's dashboard in real-time.Here are some public methods I have added in the
TreeDataProvider.ts
1. this.update : This method is not working, the UI has no changethis.delete : this method works, delete a item in the UI tree
// this.delete(id). THIS METHOD WORKS PERFECTLY. public delete(id: TId) { const item = this.items.find((i) => i.id == id); if (!item) return; this.items = this.items.filter((i) => i.id != id); this.emitter.emit(ETreeEventTypes.itemChanged, ['root', item.parentId]); }