From 33bea18463d6c9523558b66b4ad31fcf9f27d16d Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 26 Sep 2023 12:39:13 +0800 Subject: [PATCH] add column --- src/pages/PublicNoticeSearch_GLD/DataGrid.js | 41 ++++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/pages/PublicNoticeSearch_GLD/DataGrid.js b/src/pages/PublicNoticeSearch_GLD/DataGrid.js index 8c90287..16dccd4 100644 --- a/src/pages/PublicNoticeSearch_GLD/DataGrid.js +++ b/src/pages/PublicNoticeSearch_GLD/DataGrid.js @@ -29,12 +29,21 @@ export default function SearchPublicNoticeTable({ recordList }) { { field: 'actions', headerName: 'App No.', - flex: 1, + width: 150, cellClassName: 'actions', renderCell: (params) => { return ; }, }, + { + id: 'status', + field: 'status', + headerName: 'Status', + width: 150, + renderCell: (params) => { + return [StatusUtils.getStatusEng(params)] + }, + }, { id: 'created', field: 'created', @@ -71,25 +80,33 @@ export default function SearchPublicNoticeTable({ recordList }) { } }, { - id: 'remarks', - field: 'remarks', - headerName: 'Remarks', - flex: 3, + id: 'groupNo', + field: 'groupNo', + headerName: 'Gazette Group', + flex: 1, valueGetter: (params) => { return (params?.value)?(params?.value):""; } }, { - id: 'status', - field: 'status', - headerName: 'Status', - width: 150, - renderCell: (params) => { - return [StatusUtils.getStatusEng(params)] - }, + id: 'issueId', + field: 'issueId', + headerName: 'Issue No', + flex: 1, + valueGetter: (params) => { + return params.row.issueYear + +" Vol. "+zeroPad(params.row.issueVolume,3) + +", No. "+zeroPad(params.row.issueNo,2) + +", "+DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); + } }, ]; + function zeroPad(num, places) { + num=num?num:0; + var zero = places - num.toString().length + 1; + return Array(+(zero > 0 && zero)).join("0") + num; + } return (