comparer property

num Function(Part, Part) get comparer

Gets or sets the comparison function used to sort the parts.

The default value is a case-insensitive alphabetic comparison using the Part#text property of each part.

  $(go.GridLayout,
    {
      sorting: go.GridLayout.Ascending,
      comparer: (pa, pb) => {
        var da = pa.data;
        var db = pb.data;
        if (da.someProperty < db.someProperty) return -1;
        if (da.someProperty > db.someProperty) return 1;
        return 0;
      }
    }
  )

Implementation

_i2.num Function(
  _i3.Part,
  _i3.Part,
) get comparer => (
      _i3.Part p0,
      _i3.Part p1,
    ) =>
        _i4.callMethod(
          _i4.getProperty(
            this,
            'comparer',
          ),
          r'call',
          [
            this,
            p0,
            p1,
          ],
        );
set comparer (num value(Part, Part))

Implementation

set comparer(
    _i2.num Function(
      _i3.Part,
      _i3.Part,
    ) value) {
  _i4.setProperty(
    this,
    'comparer',
    _i4.allowInterop(value),
  );
}