Group Template and Node Template

Will it be possible to have a group template for the nodes present in the model. But at the same time some another collection (childItems) of that node should be treated as node templates ?

For eq.
[ { key : “grp1”, text : “Group”, childItems : [ { key : “node1”, text : “Node 1” }, { key : “node2”, text : “Node 2” }, { key : “node3”, text : “Node 3” }, { key : “node4”, text : “Node 4” } ]

  • How to define such group template ?
  • All nodes (grp1, node1, node2 etc ) should be still selectable.

(Already tried another default behavior where all nodes (group and nodes are on same level and two templates defined for same).

You can organize your data that way, but the Model.nodeDataArray is necessarily a flat Array, so you’ll need to make sure that that Array has all of those nested node data objects.

Can I do some function binding of my custom JSON object for model binding ?
So when it is first time displayed it gets converted in flat array as required and any change in diagram will always update my own JSON object from flatten nodeDataArray.

I suppose so – I don’t know enough about how your app is designed to say for sure.