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);