TanStack

ColumnDef_RowSorting

Interface: ColumnDef_RowSorting<TFeatures, TData>

Defined in: features/row-sorting/rowSortingFeature.types.ts:118

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Properties

enableMultiSort?

ts
optional enableMultiSort: boolean;

Defined in: features/row-sorting/rowSortingFeature.types.ts:125

Enables/Disables multi-sorting for this column.


enableSorting?

ts
optional enableSorting: boolean;

Defined in: features/row-sorting/rowSortingFeature.types.ts:129

Enables/Disables sorting for this column.


invertSorting?

ts
optional invertSorting: boolean;

Defined in: features/row-sorting/rowSortingFeature.types.ts:133

Inverts the order of the sorting for this column. This is useful for values that have an inverted best/worst scale where lower numbers are better, e.g. a ranking (1st, 2nd, 3rd) or golf-like scoring


sortDescFirst?

ts
optional sortDescFirst: boolean;

Defined in: features/row-sorting/rowSortingFeature.types.ts:137

Set to true for sorting toggles on this column to start in the descending direction.


sortFn?

ts
optional sortFn: SortFnOption<TFeatures, TData>;

Defined in: features/row-sorting/rowSortingFeature.types.ts:143

The sorting function to use with this column.

  • A string referencing a built-in sorting function
  • A custom sorting function

sortUndefined?

ts
optional sortUndefined: false | 1 | -1 | "first" | "last";

Defined in: features/row-sorting/rowSortingFeature.types.ts:157

The priority of undefined values when sorting this column.

  • false
    • Undefined values will be passed to the sorting function like any other value with no special handling; the sorting function is responsible for handling them
  • -1
    • Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list)
  • 1
    • Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list)
  • 'first'
    • Undefined values will be pushed to the beginning of the list regardless of sort direction
  • 'last'
    • Undefined values will be pushed to the end of the list regardless of sort direction