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.
No
| Date
| Description
| Price
|
|---|
|
|
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'
}
];
No
| Date
| Description
| Price
|
|---|
|
|
import type {BroConfig} from '@table-bro/core';
const config: BroConfig = {
server: true
};
We use Google Analytics to understand how you use our site and to make it better.
Learn more in our Privacy Policy