File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -232,8 +232,7 @@ const gridDefaultColDef = {
232232
233233 sortable : true ,
234234 filter : true ,
235- // flex: 1,
236- // minWidth: 90,
235+
237236 resizable : true ,
238237
239238 // allow every column to be aggregated
@@ -280,6 +279,12 @@ export let Datatable = {
280279 // @ts -ignore
281280 window [ `ag_grid_${ spec . instance_id } _promise` ] = gridPromise ;
282281
282+ let column_flex_enabled = (
283+ ( spec . field_args && Object . keys ( spec . field_args ) . some ( ( k : any ) => spec . field_args [ k ] . flex ) )
284+ || ( spec . path_args && spec . path_args . some ( ( k : any ) => k [ 1 ] . flex ) )
285+ || ( spec . grid_args . defaultColDef || { } ) . flex
286+ ) ;
287+
283288 const gridOptions : any = {
284289 ...gridDefaultOptions ,
285290 ...spec . grid_args ,
@@ -331,6 +336,8 @@ export let Datatable = {
331336 } ) ;
332337 }
333338 on_grid_show . then ( ( ) => {
339+ if ( column_flex_enabled )
340+ return ;
334341 gridOptions . columnApi . autoSizeAllColumns ( ) ;
335342 let content_width = 0 ;
336343 gridOptions . columnApi . getColumns ( ) . forEach ( ( column : any ) => {
You can’t perform that action at this time.
0 commit comments