From 7e7085c36652eb8239c0b5fcb53c2046e924964c Mon Sep 17 00:00:00 2001 From: testusuke Date: Wed, 24 Apr 2024 11:13:11 +0900 Subject: [PATCH 1/3] =?UTF-8?q?change:=20filter=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E6=9C=89=E5=8A=B9=E3=81=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/users/usersAgGrid.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/components/users/usersAgGrid.tsx b/components/users/usersAgGrid.tsx index 04d99ea..7c71d6b 100644 --- a/components/users/usersAgGrid.tsx +++ b/components/users/usersAgGrid.tsx @@ -39,10 +39,22 @@ const UsersAgGrid = (props: UsersAgGridProps) => { // Column Definitions: Defines & controls grid columns. const [colDefs,] = useState[]>([ {field: "userId", headerName: "ユーザーID"}, - {field: "name", headerName: "名前"}, - {field: "emailAccountName", headerName: "メール名"}, + { + field: "name", + headerName: "名前", + filter: true, + }, + { + field: "emailAccountName", + headerName: "メール名", + filter: true, + }, {field: "gender", headerName: "性別"}, - {field: "className", headerName: "クラス"}, + { + field: "className", + headerName: "クラス", + filter: true, + }, {field: "studentTeam", headerName: "チーム"}, ]); From efb6f45de04c850cfeab8515dc4caad8edfab799 Mon Sep 17 00:00:00 2001 From: testusuke Date: Wed, 24 Apr 2024 11:23:39 +0900 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20cellRenderer=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=86=E3=81=93=E3=81=A8=E3=81=A7=E7=94=BB=E9=9D=A2=E7=A7=BB?= =?UTF-8?q?=E9=81=B7=E3=81=AE=E3=83=91=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=82=92=E5=90=91=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/users/userLinkRenderer.tsx | 15 +++++++++++++++ components/users/usersAgGrid.tsx | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 components/users/userLinkRenderer.tsx diff --git a/components/users/userLinkRenderer.tsx b/components/users/userLinkRenderer.tsx new file mode 100644 index 0000000..1e787aa --- /dev/null +++ b/components/users/userLinkRenderer.tsx @@ -0,0 +1,15 @@ +import {ICellRendererParams} from "ag-grid-community"; +import Link from "next/link"; + +export default function UserLinkRenderer(param: ICellRendererParams) { + return ( + + {param.value} + + ) +} diff --git a/components/users/usersAgGrid.tsx b/components/users/usersAgGrid.tsx index 7c71d6b..d15a12c 100644 --- a/components/users/usersAgGrid.tsx +++ b/components/users/usersAgGrid.tsx @@ -10,6 +10,7 @@ import {User} from "@/src/models/UserModel"; import {Class} from '@/src/models/ClassModel'; import {Team} from "@/src/models/TeamModel"; import {useRouter} from "next/navigation"; +import UserLinkRenderer from "@/components/users/userLinkRenderer"; ModuleRegistry.registerModules([ClientSideRowModelModule]); @@ -38,7 +39,11 @@ const UsersAgGrid = (props: UsersAgGridProps) => { const [rowData, setRowData] = useState([]) // Column Definitions: Defines & controls grid columns. const [colDefs,] = useState[]>([ - {field: "userId", headerName: "ユーザーID"}, + { + field: "userId", + headerName: "ユーザーID", + cellRenderer: UserLinkRenderer, + }, { field: "name", headerName: "名前", From 46c5297d100a92804145e59564f74dca8fd9e906 Mon Sep 17 00:00:00 2001 From: testusuke Date: Wed, 24 Apr 2024 11:29:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20pagination=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8BUX=E3=81=AE=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/users/usersAgGrid.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/users/usersAgGrid.tsx b/components/users/usersAgGrid.tsx index d15a12c..c68b515 100644 --- a/components/users/usersAgGrid.tsx +++ b/components/users/usersAgGrid.tsx @@ -109,6 +109,8 @@ const UsersAgGrid = (props: UsersAgGridProps) => { rowData={rowData} columnDefs={colDefs} onRowClicked={handleRowClick} + pagination={true} + paginationAutoPageSize={true} /> );