Skip to content

Commit 4b265c1

Browse files
author
Ben Baumgold
committed
#67 allow to optionally use ag-grid enterprise
1 parent 33b451e commit 4b265c1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

deps/build.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
version = readchomp(joinpath(@__DIR__, "..", "ag-grid.version"))
22
distribution = haskey(ENV, "AG_GRID_LICENSE_KEY") ? "enterprise" : "community"
3+
println("building: distribution=$distribution version=$version")
34

45
isdir(joinpath(@__DIR__, "ag-grid-$(version)")) || mkdir(joinpath(@__DIR__, "ag-grid-$(version)"))
56

src/TableView.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,15 @@ end
199199

200200
function _showtable_sync!(w, schema, names, types, rows, coldefs, tablelength, id, options)
201201
options[:rowData] = JSONText(table2json(schema, rows, types))
202+
license = get(ENV, "AG_GRID_LICENSE_KEY", nothing)
202203
handler = @js function (RowNumberRenderer, agGrid)
203204
@var gridOptions = $options
204205
@var el = document.getElementById($id)
205206
gridOptions.components = Dict(
206207
"rowNumberRenderer" => RowNumberRenderer
207208
)
208-
if $(haskey(ENV, "AG_GRID_LICENSE_KEY"))
209-
agGrid.LicenseManager.setLicenseKey($(ENV["AG_GRID_LICENSE_KEY"]))
209+
if $(!isnothing(license))
210+
agGrid.LicenseManager.setLicenseKey($license)
210211
end
211212
this.table = @new agGrid.Grid(el, gridOptions)
212213
gridOptions.columnApi.autoSizeAllColumns()
@@ -239,6 +240,7 @@ function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength,
239240
,
240241
"rowCount" => tablelength
241242
)
243+
license = get(ENV, "AG_GRID_LICENSE_KEY", nothing)
242244

243245
handler = @js function (RowNumberRenderer, agGrid)
244246
@var gridOptions = $options
@@ -247,8 +249,8 @@ function _showtable_async!(w, schema, names, types, rows, coldefs, tablelength,
247249
gridOptions.components = Dict(
248250
"rowNumberRenderer" => RowNumberRenderer
249251
)
250-
if $(haskey(ENV, "AG_GRID_LICENSE_KEY"))
251-
agGrid.LicenseManager.setLicenseKey($(ENV["AG_GRID_LICENSE_KEY"]))
252+
if $(!isnothing(license))
253+
agGrid.LicenseManager.setLicenseKey($license)
252254
end
253255
this.table = @new agGrid.Grid(el, gridOptions)
254256
gridOptions.columnApi.autoSizeAllColumns()

0 commit comments

Comments
 (0)