@@ -68,7 +68,9 @@ function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}();
6868 cell_changed = nothing
6969 )
7070 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
7274
7375 if height === :auto
7476 height = 500
@@ -90,6 +92,7 @@ function showtable(table, options::Dict{Symbol, Any} = Dict{Symbol, Any}();
9092 push! (names, nm)
9193 push! (types, typeof (getproperty (row, nm)))
9294 end
95+ schema = Tables. Schema (names, types)
9396 else
9497 # no schema and no rows
9598 end
@@ -202,9 +205,7 @@ function _showtable_sync!(w, schema, names, types, rows, coldefs, tablelength, i
202205 " rowNumberRenderer" => RowNumberRenderer
203206 )
204207 this. table = @new agGrid. Grid (el, gridOptions)
205-
206- gridOptions. columnApi. autoSizeColumn (" __row__" )
207- gridOptions. columnApi. autoSizeColumns ($ names)
208+ gridOptions. columnApi. autoSizeAllColumns ()
208209 end
209210 onimport (w, handler)
210211end
@@ -242,10 +243,8 @@ function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength,
242243 gridOptions. components = Dict (
243244 " rowNumberRenderer" => RowNumberRenderer
244245 )
245-
246246 this. table = @new agGrid. Grid (el, gridOptions)
247- gridOptions. columnApi. autoSizeColumn (" __row__" )
248- gridOptions. columnApi. autoSizeColumns ($ names)
247+ gridOptions. columnApi. autoSizeAllColumns ()
249248 end
250249 onimport (w, handler)
251250end
0 commit comments