Browse Source

승인 체크박스 수정

pull/2/head
kimjh(김장현) 2 years ago
parent
commit
8ca4bb6d7f
  1. 26
      src/components/basis/flight/schedule/FlightScheduleGrid.js
  2. 1
      src/components/crud/grid/GridDatatable.js
  3. 15
      src/components/crud/grid/selectableRowsComponent.js

26
src/components/basis/flight/schedule/FlightScheduleGrid.js

@ -30,7 +30,7 @@ function FlightScheduleGrid() {
const columns = [ const columns = [
{ {
name: '그룹 명', name: '그룹 명',
selector: 'groupNm', selector: row => row.groupNm,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -57,7 +57,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '기체 소유자', name: '기체 소유자',
selector: 'ownerNm', selector: row => row.ownerNm,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -66,7 +66,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '기체 식별번호', name: '기체 식별번호',
selector: 'idntfNum', selector: row => row.idntfNum,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -75,7 +75,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '출발지', name: '출발지',
selector: 'startAddress', selector: row => row.startAddress,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -84,7 +84,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '비행 시작 시간', name: '비행 시작 시간',
selector: 'schFltStDt ', selector: row => row.schFltStDt,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -93,7 +93,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '도착지', name: '도착지',
selector: 'endAddress', selector: row => row.endAddress,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -102,7 +102,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '비행 종료 시간', name: '비행 종료 시간',
selector: 'schFltEndDt', selector: row => row.schFltEndDt,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -111,7 +111,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '총 예상 비행시간', name: '총 예상 비행시간',
selector: 'groupNm', selector: row => row.groupNm,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -133,7 +133,7 @@ function FlightScheduleGrid() {
}, },
{ {
name: '상태', name: '상태',
selector: 'statusCd', selector: row => row.statusCd,
minWidth: '150px', minWidth: '150px',
sortable: true, sortable: true,
cell: row => { cell: row => {
@ -151,10 +151,10 @@ function FlightScheduleGrid() {
const conditionalRowStyles = [ const conditionalRowStyles = [
{ {
when: row => true, when: row => {
style: { return true;
backgroundColor: 'red' },
} classNames: ['primary']
} }
]; ];

1
src/components/crud/grid/GridDatatable.js

@ -41,6 +41,7 @@ export const GridDatabase = props => {
{...(props.onSelectedRowsChange {...(props.onSelectedRowsChange
? { onSelectedRowsChange: props.onSelectedRowsChange } ? { onSelectedRowsChange: props.onSelectedRowsChange }
: {})} : {})}
conditionalRowStyles={props.conditionalRowStyles}
/> />
</div> </div>
</> </>

15
src/components/crud/grid/selectableRowsComponent.js

@ -3,15 +3,22 @@ import React from 'react';
export const selectableRowsComponent = React.forwardRef( export const selectableRowsComponent = React.forwardRef(
({ onClick, ...rest }, ref) => { ({ onClick, ...rest }, ref) => {
let c = new Date().getTime() + Math.random();
return ( return (
<> <div
<CustomInput className='custom-checkbox custom-control'
id={new Date().getTime() + Math.random()} style={{ paddingLeft: 0 }}
>
<input
className='custom-control-input'
id={c}
type='checkbox' type='checkbox'
ref={ref}
onClick={onClick} onClick={onClick}
{...rest} {...rest}
/> />
</> <label className='custom-control-label' for={c} />
</div>
); );
} }
); );

Loading…
Cancel
Save