MCPcopy Create free account
hub / github.com/cogentcore/core / SortSlice

Method SortSlice

core/table.go:386–392  ·  view source on GitHub ↗

SortSlice sorts the slice according to current settings.

()

Source from the content-addressed store, hash-verified

384
385// SortSlice sorts the slice according to current settings.
386func (tb *Table) SortSlice() {
387 if tb.sortIndex < 0 || tb.sortIndex >= len(tb.visibleFields) {
388 return
389 }
390 rawIndex := tb.visibleFields[tb.sortIndex].Index
391 reflectx.StructSliceSort(tb.Slice, rawIndex, !tb.sortDescending)
392}
393
394// SortColumn sorts the slice for the given field index.
395// It toggles between ascending and descending if already

Callers 3

InitMethod · 0.95
SortColumnMethod · 0.95
setSortFieldNameMethod · 0.95

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 1

StructSliceSortFunction · 0.92

Tested by

no test coverage detected