From c9e60c2a77d2e718424ae0ade510189e7e16090c Mon Sep 17 00:00:00 2001 From: KarimAldeen Date: Wed, 27 Mar 2024 12:07:18 +0300 Subject: [PATCH] #38 --- src/Pages/Categories/useTableColumns.tsx | 9 ++++----- src/Pages/Coupon/useTableColumns.tsx | 9 ++++----- src/Pages/Notifcation/useTableColumns.tsx | 9 ++++----- src/Pages/Products/useTableColumns.tsx | 9 ++++----- src/Pages/Slider/useTableColumns.tsx | 9 ++++----- src/Pages/Users/useTableColumns.tsx | 7 +++---- src/Pages/order/useTableColumns.tsx | 10 +++++----- 7 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/Pages/Categories/useTableColumns.tsx b/src/Pages/Categories/useTableColumns.tsx index 574727b..930c9f0 100644 --- a/src/Pages/Categories/useTableColumns.tsx +++ b/src/Pages/Categories/useTableColumns.tsx @@ -18,11 +18,10 @@ const useTableColumns :any = () => { { name: t("id"), - sortable: false, - center: "true", - cell: (row:any) => row?.id - }, - { + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting + }, { name: t("name"), sortable: false, center: "true", diff --git a/src/Pages/Coupon/useTableColumns.tsx b/src/Pages/Coupon/useTableColumns.tsx index 67c9cb2..37652a7 100644 --- a/src/Pages/Coupon/useTableColumns.tsx +++ b/src/Pages/Coupon/useTableColumns.tsx @@ -20,11 +20,10 @@ const useTableColumns :any = () => { { name: t("id"), - sortable: false, - center: "true", - cell: (row:any) => row?.id - }, - { + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting + }, { name: t("name"), sortable: false, center: "true", diff --git a/src/Pages/Notifcation/useTableColumns.tsx b/src/Pages/Notifcation/useTableColumns.tsx index a268044..93c89f8 100644 --- a/src/Pages/Notifcation/useTableColumns.tsx +++ b/src/Pages/Notifcation/useTableColumns.tsx @@ -24,11 +24,10 @@ const useTableColumns: any = () => { { name: t("id"), - sortable: false, - center: "true", - cell: (row:any) => row?.id - }, - { + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting + }, { name: t("name"), sortable: false, center: "true", diff --git a/src/Pages/Products/useTableColumns.tsx b/src/Pages/Products/useTableColumns.tsx index 7042093..d6af11a 100644 --- a/src/Pages/Products/useTableColumns.tsx +++ b/src/Pages/Products/useTableColumns.tsx @@ -31,11 +31,10 @@ const useTableColumns :any = () => { () => [ { name: t("id"), - sortable: false, - center: "true", - cell: (row:any) => row?.id - }, - { + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting + }, { name: t("name"), sortable: false, center: true, diff --git a/src/Pages/Slider/useTableColumns.tsx b/src/Pages/Slider/useTableColumns.tsx index 0647ce5..0f9f52c 100644 --- a/src/Pages/Slider/useTableColumns.tsx +++ b/src/Pages/Slider/useTableColumns.tsx @@ -20,11 +20,10 @@ const useTableColumns :any = () => { { name: t("id"), - sortable: false, - center: "true", - cell: (row:any) => row?.id - }, - { + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting + }, { name: t("title"), sortable: false, center: "true", diff --git a/src/Pages/Users/useTableColumns.tsx b/src/Pages/Users/useTableColumns.tsx index 4e637c2..895bc44 100644 --- a/src/Pages/Users/useTableColumns.tsx +++ b/src/Pages/Users/useTableColumns.tsx @@ -37,11 +37,10 @@ const useTableColumns: any = () => { { name: t("id"), - sortable: false, - center: "true", - cell: (row:any) => row?.id + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting }, - { name: t("avatar"), sortable: false, diff --git a/src/Pages/order/useTableColumns.tsx b/src/Pages/order/useTableColumns.tsx index b949ada..1603c1a 100644 --- a/src/Pages/order/useTableColumns.tsx +++ b/src/Pages/order/useTableColumns.tsx @@ -13,11 +13,11 @@ const useTableColumns = () => { let column = [ { - name: t("order_code"), - sortable: false, - center:true, - selector:(row:any) => row?.id, - }, + name: t("id"), + sortable: true, // Enable sorting for id column + center: true, + selector: (row: any) => row.id, // Specify selector function for sorting + }, { name: t("name"), sortable: false,