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.

Take control of the cursor, clicking on the button or the table
Loading
Items per page:
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

Take control of the cursor, clicking on the button or the table
Loading
Items per page:
0 of 0
import type {BroConfig} from '@table-bro/core';

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