From e300463ad97f02ba55e517d60db4dc5dfeab1bc2 Mon Sep 17 00:00:00 2001 From: Collin Barrett Date: Sat, 22 Sep 2018 16:19:45 -0500 Subject: [PATCH] sort tags by # then by alpha of first tag ref #509 --- .../home/components/listsTable/ListsTable.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx index ff069ea43..99b26cbbb 100644 --- a/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx +++ b/src/FilterLists.Web/ClientApp/modules/home/components/listsTable/ListsTable.tsx @@ -70,7 +70,17 @@ export const ListsTable = (props: IProps) => { (r[f.id] ? r[f.id].map((e: any) => e.name).join().toUpperCase().includes(f.value.toUpperCase()) : null), - sortable: false, + sortMethod: (a: any, b: any) => a + ? b + ? a.length === b.length + ? a[0].name > b[0].name + ? -1 + : 1 + : a.length > b.length + ? 1 + : -1 + : 1 + : -1, Cell: (c: any) => c.value ?
{c.value.map((e: any, i: number) =>