@@ -36,7 +36,8 @@ def test_sb001_sizing_buttons(dash_duo):
36
36
defaultColDef = {"resizable" : True , "sortable" : True , "filter" : True , "floatingFilter" : True },
37
37
dashGridOptions = {'rowSelection' : "multiple" },
38
38
persistence = True ,
39
- persistence_type = 'session'
39
+ persistence_type = 'session' ,
40
+ autoSizeAllColumns = {'skipHeaders' : True }
40
41
),
41
42
html .Button (id = 'autoSizeAllColumns' , children = 'Auto Size All' ),
42
43
html .Button (id = 'autoSizeAllColumnsSkipHeaders' , children = 'Auto Size All SkipHeaders' ),
@@ -47,7 +48,8 @@ def test_sb001_sizing_buttons(dash_duo):
47
48
)
48
49
49
50
@app .callback (Output ('grid' , 'autoSizeAllColumns' ),
50
- Input ('autoSizeAllColumns' , 'n_clicks' ), Input ('autoSizeAllColumnsSkipHeaders' , 'n_clicks' ))
51
+ Input ('autoSizeAllColumns' , 'n_clicks' ), Input ('autoSizeAllColumnsSkipHeaders' , 'n_clicks' ),
52
+ prevent_initial_call = True )
51
53
def setSelection (n , n2 ):
52
54
if n :
53
55
if ctx .triggered_id == 'autoSizeAllColumns' :
@@ -67,7 +69,8 @@ def setSelection(n):
67
69
Output ("columnState" , "children" ),
68
70
Input ("grid" , "columnState" ),
69
71
State ("columnState" , "children" ),
70
- State ('updateColumnState' , 'n_clicks' )
72
+ State ('updateColumnState' , 'n_clicks' ),
73
+
71
74
)
72
75
def selected (state , oldState , n ):
73
76
if state :
0 commit comments