From 749f836da188b477d4a4e92b1920146f2b21915c Mon Sep 17 00:00:00 2001 From: Kenneth Bruskiewicz Date: Thu, 22 Aug 2024 17:49:55 -0700 Subject: [PATCH] tweaks --- lib/utils/1m.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils/1m.js b/lib/utils/1m.js index afa1eb46..3d5b6710 100644 --- a/lib/utils/1m.js +++ b/lib/utils/1m.js @@ -277,7 +277,6 @@ const createRowDataManager = (hot, contextMenuCallback) => { }; const handleChange = (hot, [col, oldVal, newVal]) => { - console.log('change', hot, [col, oldVal, newVal]); hot.batch(() => { const data = hot.getSourceData(); data.every((childRow, rowIndex) => { @@ -312,7 +311,7 @@ function dispatchHandsontableUpdate(detail) { } function reselect(dh, row, prop) { - dh.hot.selectCell(row + 1, prop); + dh.hot.selectCell(row, prop); dh.hot.runHooks('afterSelection', row, prop); } @@ -328,6 +327,7 @@ function parentBroadcastsCRUD(data_harmonizers, schema_tree) { // broadcast CRUD // Create and dispatch a custom event propagatesChangesOnTheseKeys.forEach((shared_key) => { + data_harmonizers[node.name].hot.addHook( 'afterChange', (changes, source) => { @@ -348,6 +348,7 @@ function parentBroadcastsCRUD(data_harmonizers, schema_tree) { } } ); + // TODO: row insertion/deletion // Add the beforeRemoveRow and afterRemoveRow hooks using addHook const rowDataManager = createRowDataManager( @@ -395,6 +396,7 @@ function parentBroadcastsCRUD(data_harmonizers, schema_tree) { // undo_redo_callback('redo', action); // }); // // TODO: copy/paste + }); } else { console.warn('no parenthood defined', node.name);