Skip to content

Commit 169ee19

Browse files
author
Shashi Gowda
committed
fixup
1 parent 6d8c02d commit 169ee19

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
julia 0.6
22
WebIO
3-
IndexedTables
3+
JuliaDB

src/TableView.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
module TableView
22

33
using WebIO
4-
using IndexedTables
4+
using JuliaDB
55

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...)
79
w = Widget(dependencies=["https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.js",
810
"https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.34.0/handsontable.full.css"])
911
data = Observable{Any}(w, "data", [])
@@ -16,13 +18,13 @@ function showtable(t; rows=1:100, colopts=Dict(), kwargs...)
1618
vs = collect(vs)
1719
end
1820

19-
subt = IndexedTable(ks, vs)
21+
subt = NDSparse(ks, vs)
2022

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]
2325

2426
options = Dict(
25-
:data => IndexedTables.rows(subt),
27+
:data => JuliaDB.rows(subt),
2628
:colHeaders => headers,
2729
:fixedColumnsLeft => ndims(t),
2830
:modifyColWidth => @js(w -> w > 300 ? 300 : w),

0 commit comments

Comments
 (0)