동기화
This commit is contained in:
@@ -3,7 +3,7 @@ import { Skeleton } from 'antd';
|
||||
import { AgGridReact } from '@ag-grid-community/react';
|
||||
import { ModuleRegistry } from '@ag-grid-community/core';
|
||||
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
|
||||
import type { ColDef, GridReadyEvent, GridApi, RowClassParams, RowStyle } from '@ag-grid-community/core';
|
||||
import type { ColDef, GridReadyEvent, GridApi, RowClassParams, RowStyle, SelectionChangedEvent } from '@ag-grid-community/core';
|
||||
import '@ag-grid-community/styles/ag-grid.css';
|
||||
import '@ag-grid-community/styles/ag-theme-quartz.css';
|
||||
import { GRAY } from '@/theme/tokens';
|
||||
@@ -33,6 +33,8 @@ interface Props<T> {
|
||||
rowKey?: keyof T;
|
||||
/** 행별 스타일 콜백 (만료 임박 강조 등) */
|
||||
getRowStyle?: (params: RowClassParams<T>) => RowStyle | undefined;
|
||||
rowSelection?: 'single' | 'multiple';
|
||||
onSelectionChanged?: (e: SelectionChangedEvent<T>) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,6 +52,8 @@ export default function DataGrid<T extends Record<string, unknown>>({
|
||||
onCellChanged,
|
||||
rowKey,
|
||||
getRowStyle: getRowStyleProp,
|
||||
rowSelection: rowSelectionProp = 'single',
|
||||
onSelectionChanged,
|
||||
}: Props<T>) {
|
||||
const apiRef = useRef<GridApi<T> | null>(null);
|
||||
|
||||
@@ -93,7 +97,8 @@ export default function DataGrid<T extends Record<string, unknown>>({
|
||||
rowHeight={56}
|
||||
headerHeight={44}
|
||||
localeText={AG_GRID_LOCALE_KO}
|
||||
rowSelection="single"
|
||||
rowSelection={rowSelectionProp}
|
||||
onSelectionChanged={onSelectionChanged}
|
||||
getRowId={rowKey ? (p) => String(p.data[rowKey]) : undefined}
|
||||
pinnedBottomRowData={pinnedBottomRow ? [pinnedBottomRow as T] : undefined}
|
||||
getRowStyle={(params) => {
|
||||
|
||||
Reference in New Issue
Block a user