Hi,
I'm trying to add a node to a tree that has loadOnDemand: true, on client-side. I can't find anything in the API that allows adding a node, and I can't seem to add it to the data source and re-bind since the data source is loaded on demand. Is there perhaps a way to modify the current set of loaded nodes?
For example, take the tree below, given that the 100/200/300 nodes are loaded initially, and then the 010/020 nodes and 001/002/003 nodes are loaded on demand when their parent is expanded. If I want to add a node "Node 004" as another child of Node 010 (it would be a sibling to nodes 001/002/003), is that possible on client-side?
Thanks,-Jared
Hi there Jared,
Currently there is no add/delete node functionality implemented internally. However you can achieve the desired functionality. You can add objects to the data source and rebind the tree. What this would do is rerender the tree with the new data and the new node would be there then.
Please let me know if this helps, or if you need additional information. I would be glad to help you further!
Hi Konstantin, thanks for your response.
Rebinding is fine, but since I'm using loadOnDemand functionality my data source is on the server side, so the igTree is downloading parts of the data each time nodes expand by making calls to the server. Does the igTree keep an accessible client-side copy of the partial data source that has been loaded thus far when expanding various nodes? If so, I could add the new node to that local data instead of the server data, and rebind the tree to that local data to avoid extra server calls. I've been unable to find something like this in the API so far, so please let me know if it is available.