From 8ca4bb6d7feaa5a4fe789efc175e8cd1764a3167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kimjh=28=EA=B9=80=EC=9E=A5=ED=98=84=29?= Date: Wed, 5 Oct 2022 14:59:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=B9=EC=9D=B8=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=EB=B0=95=EC=8A=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/schedule/FlightScheduleGrid.js | 26 +++++++++---------- src/components/crud/grid/GridDatatable.js | 1 + .../crud/grid/selectableRowsComponent.js | 15 ++++++++--- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/components/basis/flight/schedule/FlightScheduleGrid.js b/src/components/basis/flight/schedule/FlightScheduleGrid.js index 37db6ab..b9a4b76 100644 --- a/src/components/basis/flight/schedule/FlightScheduleGrid.js +++ b/src/components/basis/flight/schedule/FlightScheduleGrid.js @@ -30,7 +30,7 @@ function FlightScheduleGrid() { const columns = [ { name: '그룹 명', - selector: 'groupNm', + selector: row => row.groupNm, minWidth: '150px', sortable: true, cell: row => { @@ -57,7 +57,7 @@ function FlightScheduleGrid() { }, { name: '기체 소유자', - selector: 'ownerNm', + selector: row => row.ownerNm, minWidth: '150px', sortable: true, cell: row => { @@ -66,7 +66,7 @@ function FlightScheduleGrid() { }, { name: '기체 식별번호', - selector: 'idntfNum', + selector: row => row.idntfNum, minWidth: '150px', sortable: true, cell: row => { @@ -75,7 +75,7 @@ function FlightScheduleGrid() { }, { name: '출발지', - selector: 'startAddress', + selector: row => row.startAddress, minWidth: '150px', sortable: true, cell: row => { @@ -84,7 +84,7 @@ function FlightScheduleGrid() { }, { name: '비행 시작 시간', - selector: 'schFltStDt ', + selector: row => row.schFltStDt, minWidth: '150px', sortable: true, cell: row => { @@ -93,7 +93,7 @@ function FlightScheduleGrid() { }, { name: '도착지', - selector: 'endAddress', + selector: row => row.endAddress, minWidth: '150px', sortable: true, cell: row => { @@ -102,7 +102,7 @@ function FlightScheduleGrid() { }, { name: '비행 종료 시간', - selector: 'schFltEndDt', + selector: row => row.schFltEndDt, minWidth: '150px', sortable: true, cell: row => { @@ -111,7 +111,7 @@ function FlightScheduleGrid() { }, { name: '총 예상 비행시간', - selector: 'groupNm', + selector: row => row.groupNm, minWidth: '150px', sortable: true, cell: row => { @@ -133,7 +133,7 @@ function FlightScheduleGrid() { }, { name: '상태', - selector: 'statusCd', + selector: row => row.statusCd, minWidth: '150px', sortable: true, cell: row => { @@ -151,10 +151,10 @@ function FlightScheduleGrid() { const conditionalRowStyles = [ { - when: row => true, - style: { - backgroundColor: 'red' - } + when: row => { + return true; + }, + classNames: ['primary'] } ]; diff --git a/src/components/crud/grid/GridDatatable.js b/src/components/crud/grid/GridDatatable.js index eae6563..04629b2 100644 --- a/src/components/crud/grid/GridDatatable.js +++ b/src/components/crud/grid/GridDatatable.js @@ -41,6 +41,7 @@ export const GridDatabase = props => { {...(props.onSelectedRowsChange ? { onSelectedRowsChange: props.onSelectedRowsChange } : {})} + conditionalRowStyles={props.conditionalRowStyles} /> diff --git a/src/components/crud/grid/selectableRowsComponent.js b/src/components/crud/grid/selectableRowsComponent.js index 8a761b9..c4afcca 100644 --- a/src/components/crud/grid/selectableRowsComponent.js +++ b/src/components/crud/grid/selectableRowsComponent.js @@ -3,15 +3,22 @@ import React from 'react'; export const selectableRowsComponent = React.forwardRef( ({ onClick, ...rest }, ref) => { + let c = new Date().getTime() + Math.random(); return ( - <> - + - +