Skip to content

Commit

Permalink
upgraded to ag-grid 15
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Wald committed Jan 4, 2018
1 parent bf03262 commit 68ded7d
Show file tree
Hide file tree
Showing 4 changed files with 10,808 additions and 9,378 deletions.
11 changes: 8 additions & 3 deletions BBjGridExWidget.bbj
Expand Up @@ -84,7 +84,7 @@ class public BBjGridExWidget extends BBjWidget
if (f_init!) then
dummy$=stbl("!OPTIONS","JAVAFX_HTMLVIEW=true")

html$="<html><body><div id='eventTransporterDiv' onClick='bbj_grid_widget_post_event(event);'></div><div id=""grid"" style=""height: 100%"" class=""ag-fresh""></div></body></html>"
html$="<html><body><div id='eventTransporterDiv' onClick='bbj_grid_widget_post_event(event);'></div><div id=""grid"" style=""height: 100%"" class=""ag-theme-fresh""></div></body></html>"
htmlview! = #getCanvas().addHtmlView(101,0,0,#getCanvas().getWidth(),#getCanvas().getHeight(),html$)
htmlview!.setCallback(BBjAPI.ON_PAGE_LOADED,#this!,"onLoad")
htmlview!.setCallback(BBjAPI.ON_NATIVE_JAVASCRIPT,#this!,"onNativeEvent")
Expand Down Expand Up @@ -337,7 +337,8 @@ class public BBjGridExWidget extends BBjWidget
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"
open (ch)"BBjGridExWidget/js/ag-grid.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$)
Expand Down Expand Up @@ -651,7 +652,11 @@ rem --------------------api methods--------------------------------

method public void setTheme(BBjString theme$)
if pos(theme$="dark#fresh#blue#bootstrap#material")>0 then
s$="document.getElementById('grid').className='ag-"+theme$+"';"
if info(3,6)="5" then
s$="$doc.getElementById('grid').className='ag-theme-"+theme$+"';"
else
s$="document.getElementById('grid').className='ag-theme-"+theme$+"';"
fi
#executeScript(s$)
fi
methodend
Expand Down
16 changes: 14 additions & 2 deletions Demo/TreeDemo.bbj
Expand Up @@ -16,8 +16,10 @@ wnd! = BBjAPI().openSysGui("X0").addWindow(10,10,1024,768,"BBj Grid Ex Demo")

grid! = new BBjGridExWidget(wnd!,100,0,0,1024,768)

grid!.setGroupColumnLabel("Customer")

grid! .setGroupColumnLabel("Customer")
grid! .setSelectionMode(grid!.GRID_SELECT_ROW())
grid! .setCallback(grid!.ON_GRID_SELECT_ROW(),"onRowSelect")

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

Expand Down Expand Up @@ -136,3 +138,13 @@ resize:
ev! = BBjAPI().getLastEvent()
grid!.setSize(ev!.getWidth(),ev!.getHeight())
return

onRowSelect:
ev! = BBjAPI().getLastEvent()
ev! = ev!.getObject()
if INFO(3,6)="5" then
a=msgbox(str(ev!.getSelectedRows()),0,str(ev!.getSelectedRowCount())+" ROW(S) SELECTED")
else
print 'SHOW', ev!.getSelectedRowCount()," ROW(S) SELECTED: ",ev!.getSelectedRows()
fi
return

0 comments on commit 68ded7d

Please sign in to comment.