Skip to content

Commit 4d16369

Browse files
committed
added sorter on books and magazines
1 parent e002272 commit 4d16369

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/components/DisplayTables/BooksTable.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const columns: ColumnsType<DataType> = [
1414
{
1515
title: 'Title',
1616
dataIndex: 'title',
17+
sorter: (a, b) => (a.title < b.title ? -1 : 1),
18+
sortDirections: ['ascend'],
1719
},
1820
{
1921
title: 'Isbn',

src/components/DisplayTables/MagazineTable.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const columns: ColumnsType<DataType> = [
1414
{
1515
title: 'Title',
1616
dataIndex: 'title',
17-
width: 200
17+
width: 200,
18+
sorter: (a, b) => (a.title < b.title ? -1 : 1),
19+
sortDirections: ['ascend'],
1820
},
1921
{
2022
title: 'Isbn',

0 commit comments

Comments
 (0)