Display sum of child node data in parent node


My nodes all contain a counter in their node data. I would like to display the sum of the child node counters in the parent nodes.

Is there some way to do this in the nodeTemplate? I was hoping to bind a field to a function that would do this.


new go.Binding(“text”, “text”, function() { sumCounters=“sum of the child node counters”; return sumCounters })


Have you seen this sample: Tournament ?