diff --git a/BBjGridExWidgetColumns.bbj b/BBjGridExWidgetColumns.bbj index efcd0aae..f63efa37 100644 --- a/BBjGridExWidgetColumns.bbj +++ b/BBjGridExWidgetColumns.bbj @@ -15,6 +15,7 @@ use java.sql.Types use com.google.gson.Gson use com.google.gson.JsonObject use com.google.gson.JsonArray +use com.google.gson.JsonParser use com.basiscomponents.db.DataField use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget use ::BBjGridExWidget/BBjGridExWidgetFilters.bbj::BBjGridExWidgetFilterInterface @@ -330,6 +331,63 @@ class public BBjGridExWidgetDefaultColumnDefinition extends BBjGridExWidgetColum rem */ field public BBjString DefaultTimestampsMask! = "%Dz.%Mz.%Yl %Hz:%mz:%sz" rem /** + rem * Icons to use inside the column instead of the grid's default icons. + rem * + rem * The icons can either be set on the grid options (all icons) or on the column definition (all except group). + rem * If defined in both the grid options and column definitions, the column definition will get used. + rem * This allows you to specify defaults in the grid options to fall back on, and then provide individual icons for + rem * specific columns. This is handy if, for example, you want to include 'A..Z' as string sort icons + rem * and just the simple arrow for other columns. + rem * + rem * The icons are set as follows: + rem *
+ rem *
+ rem * // column header items
+ rem * menu
+ rem * filter
+ rem * columns
+ rem * sortAscending
+ rem * sortDescending
+ rem * sortUnSort
+ rem *
+ rem * // row checkbox selection and tool panel column selection
+ rem * checkboxChecked
+ rem * checkboxUnchecked
+ rem * checkboxIndeterminate
+ rem *
+ rem * // tool panel column selection, when read only (ie disabled checkboxes)
+ rem * checkboxCheckedReadOnly
+ rem * checkboxUncheckedReadOnly
+ rem * checkboxIndeterminateReadOnly
+ rem *
+ rem * // when moving columns
+ rem * columnMovePin // when column is to the left, before it gets pinned
+ rem * columnMoveAdd // when adding a column
+ rem * columnMoveHide // when removing a column
+ rem * columnMoveMove // when moving a column
+ rem * columnMoveLeft // when moving and scrolling left
+ rem * columnMoveRight // when moving and scrolling right
+ rem * columnMoveGroup // when about to drop into group panel
+ rem * columnMoveValue // when about to drop into value panel
+ rem * columnMovePivot // when about to drop into pivot panel
+ rem * dropNotAllowed // when trying to drop column into group/value/pivot panel and column doesn't support it
+ rem *
+ rem * // menu
+ rem * menuPin // beside the column pin menu item
+ rem * menuValue // beside the column value menu item
+ rem * menuAddRowGroup // beside the column row group menu item
+ rem * menuRemoveRowGroup // beside the column row group menu item
+ rem * clipboardCopy // beside the copy to clipboard menu item
+ rem * clipboardPaste // beside the paste from clipboard menu item
+ rem *
+ rem * // column drop panels
+ rem * pivotPanel // beside where to drop columns for pivot
+ rem * valuePanel // beside where to drop columns for value
+ rem *
+ rem *
+ rem */
+ field public JsonObject Icons! = new JsonObject()
+ rem /**
rem * Get pinned left constant
rem *
rem * @return BBjString left
@@ -511,6 +569,17 @@ class public BBjGridExWidgetDefaultColumnDefinition extends BBjGridExWidgetColum
SWEND
methodend
rem /**
+ rem * Set the grid icons
+ rem *
+ rem * @param BBjString json! The icons as a json object
+ rem */
+ method public void setIcons(BBjString json!)
+ declare JsonParser parser!
+
+ parser! = new JsonParser()
+ #setIcons(parser!.parse(json!).getAsJsonObject())
+ methodend
+ rem /**
rem * Set the column type
rem *
rem * @param BBjString type! SQL type
@@ -608,6 +677,7 @@ class public BBjGridExWidgetDefaultColumnDefinition extends BBjGridExWidgetColum
column!.addProperty("filterValueGetter",#getFilterValueGetterExpression().toString(),err=*next)
column!.addProperty("valueSetter",#getValueSetterExpression().toString(),err=*next)
column!.addProperty("valueParser",#getValueParserExpression().toString(),err=*next)
+ column!. add("icons",iff(#getIcons().entrySet().size() <> 0 , #getIcons() , null()),err=*next)
filterEnabled! = #getEnableFilter()
filter! = #getFilter()