1
1
module TableView
2
2
3
3
using WebIO
4
+ using JSExpr
4
5
using JuliaDB
5
6
using DataValues
6
7
@@ -22,9 +23,8 @@ function showna(xs::Columns)
22
23
end
23
24
24
25
function 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" ])
28
28
29
29
trunc_rows = max (1 , first (rows)): min (length (t), last (rows))
30
30
subt = JuliaDB. subtable (t, trunc_rows)
@@ -59,13 +59,14 @@ function showtable(t::Union{DNextTable, NextTable}; rows=1:100, colopts=Dict(),
59
59
this. dom. appendChild (sizefix)
60
60
this. hot = @new Handsontable (this. dom, $ options);
61
61
end
62
- ondependencies (w, handler)
63
- w ()
62
+ onimport (w, handler)
63
+ w. dom = dom " div" ()
64
+ w
64
65
end
65
66
66
67
function 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" ])
69
70
data = Observable {Any} (w, " data" , [])
70
71
71
72
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
108
109
this. dom. appendChild (sizefix)
109
110
this. hot = @new Handsontable (this. dom, $ options);
110
111
end
111
- ondependencies (w, handler)
112
- w ()
112
+ onimport (w, handler)
113
+ w. dom = dom " div" ()
114
+ w
113
115
end
114
116
115
117
end # module
0 commit comments