11module TableView
22
33using WebIO
4+ using JSExpr
45using JuliaDB
56using DataValues
67
@@ -22,9 +23,8 @@ function showna(xs::Columns)
2223end
2324
2425function showtable (t:: Union{DNextTable, NextTable} ; rows= 1 : 100 , colopts= Dict (), kwargs... )
25- w = Widget (dependencies= [" https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.js" ,
26- " https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.css" ])
27- data = Observable {Any} (w, " data" , [])
26+ w = Scope (imports= [" https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.js" ,
27+ " https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.css" ])
2828
2929 trunc_rows = max (1 , first (rows)): min (length (t), last (rows))
3030 subt = JuliaDB. subtable (t, trunc_rows)
@@ -59,13 +59,14 @@ function showtable(t::Union{DNextTable, NextTable}; rows=1:100, colopts=Dict(),
5959 this. dom. appendChild (sizefix)
6060 this. hot = @new Handsontable (this. dom, $ options);
6161 end
62- ondependencies (w, handler)
63- w ()
62+ onimport (w, handler)
63+ w. dom = dom " div" ()
64+ w
6465end
6566
6667function showtable (t:: Union{DNDSparse, NDSparse} ; rows= 1 : 100 , colopts= Dict (), kwargs... )
67- w = Widget (dependencies = [" https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.js" ,
68- " https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.css" ])
68+ w = Scope (imports = [" https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.js" ,
69+ " https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.css" ])
6970 data = Observable {Any} (w, " data" , [])
7071
7172 trunc_rows = max (1 , first (rows)): min (length (t), last (rows))
@@ -108,8 +109,9 @@ function showtable(t::Union{DNDSparse, NDSparse}; rows=1:100, colopts=Dict(), kw
108109 this. dom. appendChild (sizefix)
109110 this. hot = @new Handsontable (this. dom, $ options);
110111 end
111- ondependencies (w, handler)
112- w ()
112+ onimport (w, handler)
113+ w. dom = dom " div" ()
114+ w
113115end
114116
115117end # module
0 commit comments