Skip to content

Commit

Permalink
introduced separate setColumnMask methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Wald committed Apr 5, 2018
1 parent 18aee56 commit 8246414
Show file tree
Hide file tree
Showing 20 changed files with 1,952 additions and 428 deletions.
42 changes: 41 additions & 1 deletion BBjGridExWidget.bbj
Expand Up @@ -332,6 +332,19 @@ class public BBjGridExWidget extends BBjWidget
wend
fi

if #ColumnDefinition! <> NULL() then
r1! = rs!.getItem(0)
ar! = #ColumnDefinition!

it! = r1!.getFieldNames().iterator()
while it!.hasNext()
f$ = it!.next()
if ar!.contains(f$) then
r1!.setFieldAttributes(f$,ar!.getFieldAttributes(f$))
fi
wend
fi

#TREE! = null()
#URL$=""
#performGridDataUpdate()
Expand Down Expand Up @@ -439,6 +452,33 @@ class public BBjGridExWidget extends BBjWidget
method public void setColumnBackColor(BBjString Field$,BBjColor color!)
#ColumnDefinition!.setFieldAttribute(Field$,"BGCOLOR","#"+hta(chr(color!.getRed()))+hta(chr(color!.getGreen()))+hta(chr(color!.getBlue())),err=*next)
methodend

rem /**
rem * set the background color of a column
rem *
rem * @param BBjString Field$: the field name of the column
rem * @param BBjString mask$: the (date or numeric) mask, BBj style, for display and editing
rem *
rem * @RequiresRefresh
rem */
method public void setColumnMask(BBjString Field$, BBjString mask$)
#this!.setColumnMask(Field$,mask$,mask$)
methodend

rem /**
rem * set the background color of a column
rem *
rem * @param BBjString Field$: the field name of the column
rem * @param BBjString renderer_mask$: the (date or numeric) mask, BBj style, for display
rem * @param BBjString editor_mask$: the (date or numeric) mask, BBj style, for editing
rem *
rem * @RequiresRefresh
rem */
method public void setColumnMask(BBjString Field$, BBjString renderer_mask$, BBjString editor_mask$)
#ColumnDefinition!.setFieldAttribute(Field$,"RENDERER_MASK",renderer_mask$)
#ColumnDefinition!.setFieldAttribute(Field$,"EDITOR_MASK",editor_mask$)
methodend

rem /**
rem * set the alignment of a column
rem * @param BBjString Field$: the field name of the column
Expand Down Expand Up @@ -470,7 +510,7 @@ class public BBjGridExWidget extends BBjWidget
rem *
rem * @param BBjGridExWidgetColumnState state! : the state object
rem */
method public void setColumnsState(BBjGridExWidgetColumnState state!)
method public void setColumnState(BBjGridExWidgetColumnState state!)
json_state$ = state!.getString()
#executeScript("gw_setState("+json_state$+")")
methodend
Expand Down
12 changes: 6 additions & 6 deletions Demo/GridColumnStateDemo.bbj
Expand Up @@ -39,20 +39,20 @@ fillGrid:
sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore"))
rs! = sbc!.retrieve("SELECT * FROM CDINVENTORY")


rem setting up the columns that should be displayed (the result set has more)
grid!.addColumn("CDNUMBER","Item#")
grid!.addColumn("COST","COST",2)
grid!.addColumn("COST","COST",Types.DOUBLE)
grid!.addColumn("ARTIST","Artist Name")
grid!.addColumn("TITLE","Record Title")
grid!.addColumn("LABEL","Publisher")
grid!.addColumn("PLAYINGTIME","Playing Time (min)",Types.INTEGER)
grid!.setColumnAlignment("COST",grid!.GRID_ALIGN_RIGHT())
grid!.setColumnMask("COST","$ #.##0,00")

grid!.setSelectionMode(grid!.GRID_SELECT_ROW())

rs!.setAttribute(10,"MASK","$#,##00")


grid!.setData(rs!)



grid!.setCallback(grid!.ON_GRID_SELECT_ROW(),"onRowSelect")
grid!.setCallback(grid!.ON_GRID_DOUBLE_CLICK(),"onRowDoubleclick")
Expand Down
1,397 changes: 1,066 additions & 331 deletions docs/javadoc/BBjGridExWidget.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/javadoc/BBjGridExWidgetColumnState.html
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_144) on Wed Mar 07 13:24:08 CET 2018 -->
<!-- Generated by javadoc (1.8.0_144) on Thu Apr 05 14:58:27 CEST 2018 -->
<title>BBjGridExWidgetColumnState</title>
<meta name="date" content="2018-03-07">
<meta name="date" content="2018-04-05">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/javadoc/BBjGridExWidgetDoubleClickRowEvent.html
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_144) on Wed Mar 07 13:24:08 CET 2018 -->
<!-- Generated by javadoc (1.8.0_144) on Thu Apr 05 14:58:27 CEST 2018 -->
<title>BBjGridExWidgetDoubleClickRowEvent</title>
<meta name="date" content="2018-03-07">
<meta name="date" content="2018-04-05">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions docs/javadoc/BBjGridExWidgetRow.html
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_144) on Wed Mar 07 13:24:08 CET 2018 -->
<!-- Generated by javadoc (1.8.0_144) on Thu Apr 05 14:58:27 CEST 2018 -->
<title>BBjGridExWidgetRow</title>
<meta name="date" content="2018-03-07">
<meta name="date" content="2018-04-05">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
10 changes: 5 additions & 5 deletions docs/javadoc/BBjGridExWidgetSelectRowEvent.html
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_144) on Wed Mar 07 13:24:08 CET 2018 -->
<!-- Generated by javadoc (1.8.0_144) on Thu Apr 05 14:58:27 CEST 2018 -->
<title>BBjGridExWidgetSelectRowEvent</title>
<meta name="date" content="2018-03-07">
<meta name="date" content="2018-04-05">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down Expand Up @@ -48,7 +48,7 @@
<div class="subNav">
<ul class="navList">
<li><a href="BBjGridExWidgetRow.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
<li><a href="BBjGridWidgetCellEditingEvent.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="index.html?BBjGridExWidgetSelectRowEvent.html" target="_top">Frames</a></li>
Expand Down Expand Up @@ -384,7 +384,7 @@ <h4>getNewDeselectedRows</h4>
<div class="subNav">
<ul class="navList">
<li><a href="BBjGridExWidgetRow.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
<li><a href="BBjGridWidgetCellEditingEvent.html" title="class in &lt;Unnamed&gt;"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="index.html?BBjGridExWidgetSelectRowEvent.html" target="_top">Frames</a></li>
Expand Down

0 comments on commit 8246414

Please sign in to comment.