@jedidiah wrote:
Hi, I am trying to modify the Genogram example to sort a family tree based on birth year
found the documentation code below which I should be able to adapt fairly easily but I can't see where I can insert this in the Genogram example as it uses a custom layout ..
any help is much appreciated
thanks
$(go.Diagram, . . .,
{
layout:
$(go.TreeLayout,
{
sorting: go.TreeLayout.SortingAscending,
comparer: function(a, b) {
// A and B are TreeVertexes
var av = a.node.data.index;
var bv = b.node.data.index;
if (av < bv) return -1;
if (av > bv) return 1;
return 0;
},
. . .
})
. . .
})
Posts: 2
Participants: 2