st: refactor: 그리드 prop isExcelExport(엑셀 내보내기 버튼 유무)추가, mergeRule, sortdisable 추가

컬럼 속성에 mergeRule: true시 해당 컬럼 같은 값인 cell merge
sortdisable: true시 해당 컬럼의 정렬 기능 비활성화
This commit is contained in:
2026-01-07 11:07:56 +09:00
parent 96aecb9847
commit cbded3e605
7 changed files with 143 additions and 5 deletions
+3 -3
View File
@@ -36,7 +36,7 @@ if (typeof window !== "undefined") {
RealGrid.setLicenseKey(process.env.NEXT_PUBLIC_ST_REALGRID_KEY || '');
const DataGrid = ({ columnInfo, rowStartNum, isExcelImport = true, fixedColumns, showHeaderCheckbox = false, rowData, setRowData }: DataGridProps) => {
const DataGrid = ({ columnInfo, rowStartNum, isExcelImport = true, isExcelExport = true, fixedColumns, showHeaderCheckbox = false, rowData, setRowData }: DataGridProps) => {
const { columns, columnLayout } = columnInfo;
const gridRef = useRef<RealGridReact>(null);
const fileInputRef = useRef<HTMLInputElement>(null);
@@ -312,10 +312,10 @@ const DataGrid = ({ columnInfo, rowStartNum, isExcelImport = true, fixedColumns,
<span>가져오기</span>
</Button>
}
<Button className="h-[3.2rem] px-6 bg-gradient-green hover:bg-gradient-green-hover w-[96px]" type="button" onClick={exportExcel}>
{isExcelExport && <Button className="h-[3.2rem] px-6 bg-gradient-green hover:bg-gradient-green-hover w-[96px]" type="button" onClick={exportExcel}>
<i className="diveicon di-file-excel" />
<span>내보내기</span>
</Button>
</Button>}
</div>
<div className="h-[65vh]">
<RealGridReact
@@ -37,7 +37,7 @@ if (typeof window !== "undefined") {
RealGrid.setLicenseKey(process.env.NEXT_PUBLIC_ST_REALGRID_KEY || '');
const TabDataGrid = ({ columnInfo, isExcelImport = true, rows = [], showHeaderCheckbox = false, rowDataMap, setRowDataMap }: TabDataGridProps) => {
const TabDataGrid = ({ columnInfo, isExcelImport = true, isExcelExport = true, rows = [], showHeaderCheckbox = false, rowDataMap, setRowDataMap }: TabDataGridProps) => {
// 각 탭별로 그리드 ref와 데이터를 관리
const gridRefs = useRef<Map<string, RealGridReact>>(new Map());
const fileInputRefs = useRef<Map<string, HTMLInputElement>>(new Map());
@@ -450,7 +450,7 @@ const TabDataGrid = ({ columnInfo, isExcelImport = true, rows = [], showHeaderCh
expression: column.footer.expression,
numberFormat: column.footer.numberFormat,
} : undefined}
mergeRule={column.mergeCells ? { criteria: 'row div 2' } : undefined}
mergeRule={column.mergeCells ? { criteria: 'value' } : undefined}
sortable={!column.sortdisable}
/>
))}