[st] - any type 수정, 검토 그리드 cell style 수정
This commit is contained in:
@@ -729,7 +729,6 @@ const DataGrid = ({
|
||||
idFieldName = "id",
|
||||
enableSort = false,
|
||||
gridHeight = 55, // vh 단위
|
||||
onRowDblClick,
|
||||
headerHeight = 60,
|
||||
fitStyle = GridFitStyle.EVEN,
|
||||
}: DataGridProps) => {
|
||||
@@ -789,20 +788,25 @@ useEffect(() => {
|
||||
const gridView = gridRef.current?.gridView;
|
||||
if (!gridView || !onCellDblClick) return;
|
||||
|
||||
(gridView as any).onCellDblClicked = (_grid: unknown, clickData: { cellType?: string; itemIndex?: number }) => {
|
||||
gridView.onCellDblClicked = (_grid, clickData) => {
|
||||
if (clickData.cellType !== "data" || clickData.itemIndex === undefined) return;
|
||||
const row = rowDataRef.current[clickData.itemIndex];
|
||||
const cellIndex = (gridView as any).getCurrent?.();
|
||||
const fieldName = cellIndex?.fieldName ?? cellIndex?.column ?? "";
|
||||
if (row) onCellDblClick({ // ← 여기는 Props 콜백 호출이라 그대로
|
||||
row: row as Record<string, string | number>,
|
||||
fieldName,
|
||||
itemIndex: clickData.itemIndex
|
||||
});
|
||||
const cellIndex = gridView.getCurrent();
|
||||
const column = cellIndex.column;
|
||||
const fieldName =
|
||||
cellIndex.fieldName ??
|
||||
(typeof column === "string" ? column : "");
|
||||
if (row) {
|
||||
onCellDblClick({
|
||||
row: row as Record<string, string | number>,
|
||||
fieldName,
|
||||
itemIndex: clickData.itemIndex,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return () => {
|
||||
(gridView as any).onCellDblClicked = undefined;
|
||||
gridView.onCellDblClicked = undefined;
|
||||
};
|
||||
}, [onCellDblClick]);
|
||||
useLayoutEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user