From 1417bc847bef04a0b01111976250b23f119eb9e6 Mon Sep 17 00:00:00 2001 From: Josh Lancaster Date: Fri, 20 Feb 2026 11:08:04 -0500 Subject: [PATCH] fix: use correct AG Grid event for auto export row selection sync Change 'rowSelected' to 'selectionChanged' in widget_builder.js. The auto export mode was listening to AG Grid's 'rowSelected' event, which fires per individual row toggle and causes inconsistent selection state during rapid successive updates. The correct event is 'selectionChanged', which fires once after the overall selection state is settled and is the standard event to pair with api.getSelectedRows(). This fixes export_mode='auto' not syncing selected row data from JS to Python via _grid_data_up / grid_data_out. Fixes #68 Fixes #76 --- js/src/widget_builder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/widget_builder.js b/js/src/widget_builder.js index e6b8431..7ad69dc 100644 --- a/js/src/widget_builder.js +++ b/js/src/widget_builder.js @@ -177,7 +177,7 @@ const buildAgGrid = (view, gridData, gridOptions_str, div, sheet, dropdownMulti }); } if ('rowSelection' in gridOptions) { - gridOptions.api.addEventListener('rowSelected', () => { + gridOptions.api.addEventListener('selectionChanged', () => { exportFunc.exportRows(gridOptions, view); }); }