Incremental tree with dynamic children via ajax

Is there a good example of using an incremental tree using an ajax call to get the child objects?

Change the click handler in the button to do your AJAX request. Have a successful response conduct a transaction that does what the existing sample does in the transaction.

Thanks for your reply. I guess the example I’m looking for would dynamically know whether to show the expand button based on whether the object has children (which is a property on my models). And then go make a request to get the children from the server.

The example linked seems to create every node as a parent. Thanks

You can see the definition of the “TreeExpanderButton” at http://gojs.net/latest/extensions/Buttons.js. Note how the visibility of the button depends on the value of Node.isTreeLeaf.

Have you tried a Binding of the Node.isTreeLeaf property to your data property that indicates that there are no children?