sortBySortIdx method
Implementation
@override
void sortBySortIdx(PlutoColumn column, {bool notify = true}) {
_updateBeforeColumnSort();
if (sortOnlyEvent) return;
int compare(a, b) {
if (a.sortIdx == null || b.sortIdx == null) {
if (a.sortIdx == null && b.sortIdx == null) {
return 0;
}
return a.sortIdx == null ? -1 : 1;
}
return a.sortIdx!.compareTo(b.sortIdx!);
}
if (enabledRowGroups) {
sortRowGroup(column: column, compare: compare);
} else {
refRows.sort(compare);
}
notifyListeners(notify, sortBySortIdx.hashCode);
}