DVUI

sortChanged

For automatic management of sort order, this must be called whenever the sort order for any column has changed.

Parameters

#
self:*GridWidget
*GridWidget
col_num:usize
usize

Source

Implementation

#
pub fn sortChanged(self: *GridWidget, col_num: usize) void {
    // If sorting on a new column, change current sort column to unsorted.
    if (col_num != self.sort_col_number) {
        self.sort_direction = .unsorted;
        self.sort_col_number = col_num;
    }
    // If new sort column, then ascending, otherwise opposite of current sort.
    self.sort_direction = if (self.sort_direction != .ascending) .ascending else .descending;
}