comparer property
num Function(TreeVertex, TreeVertex)
get
comparer
Gets or sets the default comparison function used for sorting the immediate children of a vertex.
The default comparer compares the LayoutVertex#node Text values.
This sets the #rootDefaults' property of the same name. Whether this comparison function is used is determined by the value of #sorting.
$(go.TreeLayout,
{
sorting: go.TreeLayout.SortingAscending,
comparer: (va, vb) => {
var da = va.node.data;
var db = vb.node.data;
if (da.someProperty < db.someProperty) return -1;
if (da.someProperty > db.someProperty) return 1;
return 0;
}
}
)
Implementation
_i2.num Function(
_i3.TreeVertex,
_i3.TreeVertex,
) get comparer => (
_i3.TreeVertex p0,
_i3.TreeVertex p1,
) =>
_i4.callMethod(
_i4.getProperty(
this,
'comparer',
),
r'call',
[
this,
p0,
p1,
],
);
set
comparer
(num value(TreeVertex, TreeVertex))
Implementation
set comparer(
_i2.num Function(
_i3.TreeVertex,
_i3.TreeVertex,
) value) {
_i4.setProperty(
this,
'comparer',
_i4.allowInterop(value),
);
}