@@ -68,7 +68,9 @@ function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}();
68
68
cell_changed = nothing
69
69
)
70
70
rows = Tables. rows (table)
71
- tablelength = Base. IteratorSize (rows) == Base. HasLength () ? length (rows) : nothing
71
+ it_sz = Base. IteratorSize (rows)
72
+ has_len = it_sz isa Base. HasLength || it_sz isa Base. HasShape
73
+ tablelength = has_len ? length (rows) : nothing
72
74
73
75
if height === :auto
74
76
height = 500
@@ -90,6 +92,7 @@ function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}();
90
92
push! (names, nm)
91
93
push! (types, typeof (getproperty (row, nm)))
92
94
end
95
+ schema = Tables. Schema (names, types)
93
96
else
94
97
# no schema and no rows
95
98
end
@@ -202,9 +205,7 @@ function _showtable_sync!(w, schema, names, types, rows, coldefs, tablelength, i
202
205
" rowNumberRenderer" => RowNumberRenderer
203
206
)
204
207
this. table = @new agGrid. Grid (el, gridOptions)
205
-
206
- gridOptions. columnApi. autoSizeColumn (" __row__" )
207
- gridOptions. columnApi. autoSizeColumns ($ names)
208
+ gridOptions. columnApi. autoSizeAllColumns ()
208
209
end
209
210
onimport (w, handler)
210
211
end
@@ -242,10 +243,8 @@ function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength,
242
243
gridOptions. components = Dict (
243
244
" rowNumberRenderer" => RowNumberRenderer
244
245
)
245
-
246
246
this. table = @new agGrid. Grid (el, gridOptions)
247
- gridOptions. columnApi. autoSizeColumn (" __row__" )
248
- gridOptions. columnApi. autoSizeColumns ($ names)
247
+ gridOptions. columnApi. autoSizeAllColumns ()
249
248
end
250
249
onimport (w, handler)
251
250
end
0 commit comments