1
1
module TableView
2
2
3
3
using WebIO
4
- using IndexedTables
4
+ using JuliaDB
5
5
6
- function showtable (t; rows= 1 : 100 , colopts= Dict (), kwargs... )
6
+ import JuliaDB: DNDSparse
7
+
8
+ function showtable (t:: Union{DNDSparse, NDSparse} ; rows= 1 : 100 , colopts= Dict (), kwargs... )
7
9
w = Widget (dependencies= [" https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.js" ,
8
10
" https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.css" ])
9
11
data = Observable {Any} (w, " data" , [])
@@ -16,13 +18,13 @@ function showtable(t; rows=1:100, colopts=Dict(), kwargs...)
16
18
vs = collect (vs)
17
19
end
18
20
19
- subt = IndexedTable (ks, vs)
21
+ subt = NDSparse (ks, vs)
20
22
21
- headers = [ fieldnames ( eltype (ks)); fieldnames ( eltype (t));]
22
- cols = [merge (Dict (:data => n), get (colopts, n, Dict ())) for n in fieldnames ( columns (subt)) ]
23
+ headers = colnames (subt)
24
+ cols = [merge (Dict (:data => n), get (colopts, n, Dict ())) for n in headers ]
23
25
24
26
options = Dict (
25
- :data => IndexedTables . rows (subt),
27
+ :data => JuliaDB . rows (subt),
26
28
:colHeaders => headers,
27
29
:fixedColumnsLeft => ndims (t),
28
30
:modifyColWidth => @js (w -> w > 300 ? 300 : w),
0 commit comments