Custom sorting rules

You can specify a sortKey for each column to control the sorting behavior.

For example, the "Date" column can display a formatted date (model's date), while sorting is performed based on the model's underlying timestamp field.

Only user manual clicks work on Native browser elements
Loading
Items per page:
Clear
import type {BroCol, BroRow} from '@table-bro/core';

interface Order extends BroRow {
  date: string; // the formatted date that the column shows
  timestamp: number; // the date that the column sorts by
}

const cols: BroCol<Order>[] = [
  {
    title: 'Date',
    name: 'date',
    sortKey: 'timestamp'
  }
];

Custom sorting rules with server-side data loading

Only user manual clicks work on Native browser elements
Loading
Items per page:
0 of 0
Clear
import type {BroConfig} from '@table-bro/core';

const config: BroConfig = {
  server: true
};
DJ