From 5acdcce35c0435a77b1b0c07ed9ac4d24192be2b Mon Sep 17 00:00:00 2001 From: Matt Gallagher Date: Fri, 28 Jun 2024 14:26:04 +0100 Subject: [PATCH] Fix onColumnGroupOpened --- src/AgGrid.fs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/AgGrid.fs b/src/AgGrid.fs index c8c3069..f2485f5 100644 --- a/src/AgGrid.fs +++ b/src/AgGrid.fs @@ -559,12 +559,17 @@ type AgGrid<'row> = {| AutoSizeGroupColumns = fun () -> - // Runs the column autoSize in a 0ms timeout so that the cellRendererFramework cells render - // before the grid calculates how large each cell is + // Runs the column autoSize in a 0ms timeout so that the cellRenderer cells render before + // the grid calculates how large each cell is JS.setTimeout (fun () -> - let colIds = ev?columnGroup?children |> Array.map (fun x -> x?colId) - ev?columnApi?autoSizeColumns colIds) + let colIds = + ev?columnGroups + |> Seq.head + |> fun cg -> cg?children + |> Array.map (fun x -> x?colId) + + ev?api?autoSizeColumns colIds) 0 |> ignore |}