Skip to content

Commit

Permalink
added first code to distinguish license key
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Wald committed Feb 28, 2018
1 parent 294aa26 commit d634a1a
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 17 deletions.
55 changes: 38 additions & 17 deletions BBjGridExWidget.bbj
Expand Up @@ -147,6 +147,8 @@ class public BBjGridExWidget extends BBjWidget
field private DataRow ColumnDefinition!

field private HashMap SelectedRowsMap! = new HashMap()

field public static BBjString LicenseKey$

rem --------------------- constructors -------------------------------------
rem /**
Expand Down Expand Up @@ -632,23 +634,43 @@ class public BBjGridExWidget extends BBjWidget

ch=unt

rem loading the patched ag-grid in BUI until they will have fixed their code for the getDocument method
if INFO(3,6)="5" then
rem open (ch)"BBjGridExWidget/js/ag-grid-enterprise.js"
rem open (ch)"BBjGridExWidget/js/ag-grid.js"
open (ch)"BBjGridExWidget/js/ag-grid.min.js"
read record (ch,siz=5512000)script$
close (ch)
#HTMLView!.injectScript(script$)
#HTMLView!.injectScript(script$,1)
else
rem open (ch)"BBjGridExWidget/js/ag-grid-enterprise.js"
open (ch)"BBjGridExWidget/js/ag-grid.min.js"
read record (ch,siz=5512000)script$
close (ch)
#HTMLView!.injectScript(script$,1)
fi
if (BBjGridExWidget.getLicenseKey()>"") then

rem loading the patched ag-grid in BUI until they will have fixed their code for the getDocument method
if INFO(3,6)="5" then
open (ch)"BBjGridExWidget/js/ag-grid-enterprise.min.js"
read record (ch,siz=5512000)script$
close (ch)
#HTMLView!.injectScript(script$)
#HTMLView!.injectScript(script$,1)
else
open (ch)"BBjGridExWidget/js/ag-grid-enterprise.min.js"
read record (ch,siz=5512000)script$
close (ch)
#HTMLView!.injectScript(script$,1)
fi

else

rem loading the patched ag-grid in BUI until they will have fixed their code for the getDocument method
if INFO(3,6)="5" then
rem open (ch)"BBjGridExWidget/js/ag-grid-enterprise.js"
rem open (ch)"BBjGridExWidget/js/ag-grid.js"
open (ch)"BBjGridExWidget/js/ag-grid.min.js"
read record (ch,siz=5512000)script$
close (ch)
#HTMLView!.injectScript(script$)
#HTMLView!.injectScript(script$,1)
else
rem open (ch)"BBjGridExWidget/js/ag-grid-enterprise.js"
open (ch)"BBjGridExWidget/js/ag-grid.min.js"
read record (ch,siz=5512000)script$
close (ch)
#HTMLView!.injectScript(script$,1)
fi

endif

ch=unt
open (ch)"BBjGridExWidget/js/bbj-masks.min.js"
read record (ch,siz=5512000)script$
Expand Down Expand Up @@ -1131,6 +1153,5 @@ rem --------------------api methods--------------------------------
methodret "bottom"
methodend


classend

56 changes: 56 additions & 0 deletions Demo/EnterpriseFeaturesDemo.bbj
@@ -0,0 +1,56 @@
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
use com.basiscomponents.bc.SqlQueryBC
use java.sql.Types

? 'HIDE'

declare auto BBjTopLevelWindow wnd!
declare auto BBjListButton lb_db!
declare auto BBjListButton lb_tbl!
declare auto BBjToolButton btn_fit!
declare BBjGridExWidget grid!

lic!=System.getProperty("bbjgridexwidget.license")

if lic!=null() or str(lic!)="" then
a=msgbox("set license key in bbj.properties under bbjgridexwidget.license=<yourlicense>",48,"Demo for Enterprise Features")
release
fi

BBjGridExWidget.setLicenseKey(lic!)

wnd! = BBjAPI().openSysGui("X0").addWindow(10,10,800,600,"BBj Grid Ex Demo")

grid! = new BBjGridExWidget(wnd!,100,0,0,800,600)

wnd! .setCallback(BBjAPI.ON_CLOSE,"byebye")
wnd! .setCallback(BBjAPI.ON_RESIZE,"resize")

gosub fillGrid

process_events


fillGrid:

declare SqlQueryBC sbc!
sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore"))
rs! = sbc!.retrieve("SELECT * FROM CDINVENTORY")

filter! = new com.basiscomponents.db.DataRow()
filter!.setFieldValue("RECORDINGTYPE","cond:<DDD&>AAD")

rs! = rs!.filterBy(filter!)

grid!.setData(rs!)

return

byebye:
bye

resize:
ev! = BBjAPI().getLastEvent()
grid!.setSize(ev!.getWidth(),ev!.getHeight())
return

2 changes: 2 additions & 0 deletions js/ag-grid-enterprise.min.js

Large diffs are not rendered by default.

0 comments on commit d634a1a

Please sign in to comment.