@@ -199,14 +199,15 @@ end
199199
200200function _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