sortFieldName returns the name of the field being sorted, along with :up or :down depending on ascending or descending sorting.
()
| 428 | // sortFieldName returns the name of the field being sorted, along with :up or |
| 429 | // :down depending on ascending or descending sorting. |
| 430 | func (tb *Table) sortFieldName() string { |
| 431 | if tb.sortIndex >= 0 && tb.sortIndex < tb.numVisibleFields { |
| 432 | nm := tb.visibleFields[tb.sortIndex].Name |
| 433 | if tb.sortDescending { |
| 434 | nm += ":down" |
| 435 | } else { |
| 436 | nm += ":up" |
| 437 | } |
| 438 | return nm |
| 439 | } |
| 440 | return "" |
| 441 | } |
| 442 | |
| 443 | // setSortFieldName sets sorting to happen on given field and direction |
| 444 | // see [Table.sortFieldName] for details. |
no outgoing calls
no test coverage detected