Skip to content

Commit

Permalink
[DAT-436] Sort the data table with secondary column
Browse files Browse the repository at this point in the history
  • Loading branch information
myanghua committed May 7, 2021
1 parent 94ddcfd commit 659a2ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/list/components/results/resultsTable.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import MechanismModel from "../../../shared/models/mechanism.model";
const cellStyle = {padding: "0px 5px"};

const tableColumns = [
{title: "Mechanism", field: "name", cellStyle: cellStyle, defaultSort: "asc" as ('asc' | 'desc')},
{title: "OU", field: "ou", cellStyle: cellStyle},
{title: "Agency", field: "agency", cellStyle: cellStyle},
{title: "Partner", field: "partner", cellStyle: cellStyle},
{title: "Status", field: "status", cellStyle: cellStyle},
{title: "Mechanism", field: "name", cellStyle: cellStyle, defaultSort: "asc" as ('asc' | 'desc'), customSort: (a, b) => (a.name + a.ou) > (b.name + b.ou) ? 1 : -1},
{title: "OU", field: "ou", cellStyle: cellStyle, defaultSort: "asc" as ('asc' | 'desc'), customSort: (a, b) => (a.ou + a.name) > (b.ou + b.name) ? 1 : -1},
{title: "Agency", field: "agency", cellStyle: cellStyle, defaultSort: "asc" as ('asc' | 'desc'), customSort: (a, b) => (a.agency + a.name) > (b.agency + b.name) ? 1 : -1},
{title: "Partner", field: "partner", cellStyle: cellStyle, customSort: (a, b) => (a.partner + a.name) > (b.partner + b.name) ? 1 : -1},
{title: "Status", field: "status", cellStyle: cellStyle, customSort: (a, b) => (a.status + a.name) > (b.status + b.name) ? 1 : -1},
];

const localization = {
Expand Down

0 comments on commit 659a2ea

Please sign in to comment.