Skip to Content
0
Mar 25, 2014 at 06:24 PM

Tree control model binding

307 Views

Hi all,

I need to develop a UI5 tree control based on a JSON model, retrieving children of each node dynamically from the server through ajax.

Specifically, I don't want to load all the contents from the server at once.

Additionally, I don't want to create nodes manually with addNode() method, which seems to be against the control-bound-to-model pattern

I'd like to create nodes in the model according to a parent/child association and these be bound to the nodes in the tree.

I can see that the Tree control has a bindNodes() method, which looks promising to bind the root of the tree.

I can also see that the TreeNode control has a toggleStateOpen handler, which might load further contents from the server.

However I am not sure whether this is the right approach or there's an easier route.

I'd be really grateful if anyone with experience on this matter might provide some insight.

Thanks a lot

Regards

Vincenzo