From f3ddd4d84bacf9af2cac8d727599f74b0d76d9e5 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 16 Aug 2026 20:42:18 +0900 Subject: [PATCH] fix(fe): KsDataGrid + CommonCodeManagementPage - grid edit issues Fixed 3 critical bugs in grid editing: 1. onCellValueChanged redrawRows() removal - Removed event.api.redrawRows() that was resetting cell input - Issue: redrawRows() triggered computed property re-evaluation - Result: Array reference changed, grid lost input value 2. ScrollApiModule registration - Added ScrollApiModule to ModuleRegistry - Issue: focusRow() called ensureIndexVisible without module - Result: AG Grid #200 error, page hung 3. onCellEditingStopped removal - Removed auto-restart of edit mode on cell exit - Issue: Prevented navigateToNextCell from working on Enter key - Result: Enter key now properly moves focus to next cell 4. CommonCodeManagementPage focusRow safety - Wrapped focusRow() in try-catch - Issue: focusRow may not be available, causing errors - Result: Grid continues even if focusRow unavailable Affects: /system/common-codes grid editing and all pages using KsDataGrid Co-Authored-By: Claude Haiku 4.5 --- .../system/pages/CommonCodeManagementPage.vue | 14 +- .../src/shared/ui/components/KsDataGrid.vue | 229 +++++++++++++++++- 2 files changed, 229 insertions(+), 14 deletions(-) diff --git a/frontend/src/features/system/pages/CommonCodeManagementPage.vue b/frontend/src/features/system/pages/CommonCodeManagementPage.vue index f9549c4c..364ec6cc 100644 --- a/frontend/src/features/system/pages/CommonCodeManagementPage.vue +++ b/frontend/src/features/system/pages/CommonCodeManagementPage.vue @@ -236,11 +236,11 @@ const saveMasterBatch = () => { // Inline Child Code Grid Editing Handlers (Top-Row Insertion) const addGridRow = () => { const groupCodeKey = selectedGroupCode.value.groupCode - let list = mockChildCodesMap[groupCodeKey] - if (!list) { - list = [] - Object.assign(mockChildCodesMap, { [groupCodeKey]: list }) + if (!mockChildCodesMap[groupCodeKey]) { + mockChildCodesMap[groupCodeKey] = reactive([]) } + const list = mockChildCodesMap[groupCodeKey] + const newRow: CommonCode = { code: `NEW_CODE_${list.length + 1}`, codeName: 'μƒˆ μ½”λ“œλͺ…', @@ -256,7 +256,11 @@ const addGridRow = () => { selectedGroupCode.value.codeCount = list.length nextTick(() => { - detailGridRef.value?.focusRow(0, 'code') + try { + detailGridRef.value?.focusRow?.(0, 'code') + } catch (e) { + console.warn('focusRow not available', e) + } }) } diff --git a/frontend/src/shared/ui/components/KsDataGrid.vue b/frontend/src/shared/ui/components/KsDataGrid.vue index 7b032a3d..a8ee15d1 100644 --- a/frontend/src/shared/ui/components/KsDataGrid.vue +++ b/frontend/src/shared/ui/components/KsDataGrid.vue @@ -1,22 +1,63 @@ + + + + + +