SortSlice sorts the slice according to current settings.
()
| 384 | |
| 385 | // SortSlice sorts the slice according to current settings. |
| 386 | func (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 |
no test coverage detected