public class GridWidget extends BBjWidget implements DataFillableWidget, SaveableWidget, EmailableWidget
Modifier and Type | Field and Description |
---|---|
BBjNumber |
AllColumnsUserSortable
A number that acts as a boolean, determining whether the grid should configure all columns to be sortable
|
BBjNumber |
AutoResizeColumns
A number acting as a boolean that determines whether the grid should size its columns to fit the widget.
|
BBjNumber |
AutoResizeGrid
A number acting as a boolean that determines whether the grid should size its columns to fit its data.
|
static BBjNumber |
CELL_STYLE_CHECKED
A constant to define grid column style, used in conjunction with the setColumnStyle() method
|
static BBjNumber |
CELL_STYLE_INPUTD
A constant to define grid column style, used in conjunction with the setColumnStyle() method
|
static BBjNumber |
CELL_STYLE_INPUTE
A constant to define grid column style, used in conjunction with the setColumnStyle() method
|
static BBjNumber |
CELL_STYLE_INPUTN
A constant to define grid column style, used in conjunction with the setColumnStyle() method
|
static BBjNumber |
CELL_STYLE_TEXT
A constant to define grid column style, used in conjunction with the setColumnStyle() method
|
static BBjNumber |
CELL_STYLE_UNCHECKED
A constant to define grid column style, used in conjunction with the setColumnStyle() method
|
static BBjNumber |
CLICK_TARGET_CELL
A constant to define where the user clicked on the grid.
|
static BBjNumber |
CLICK_TARGET_COLUMN_HEADER
A constant to define where the user clicked on the grid.
|
static BBjNumber |
CLICK_TARGET_CORNER
A constant to define where the user clicked on the grid.
|
static BBjNumber |
CLICK_TARGET_ROW_HEADER
A constant to define where the user clicked on the grid.
|
static BBjNumber |
CLICK_TARGET_SCROLLBAR
A constant to define where the user clicked on the grid.
|
static BBjNumber |
ClickTarget
A number representing where the user last clicked on the GridWidget.
|
static BBjNumber |
COLUMN_WIDTHS_FROM_DATA
A constant to define the algorithm used to determine the grid column widths, used in conjunction with the setColumnWidths() method.
|
static BBjNumber |
COLUMN_WIDTHS_FROM_HEADER
A constant to define the algorithm used to determine the grid column widths, used in conjunction with the setColumnWidths() method.
|
static BBjNumber |
COLUMN_WIDTHS_FROM_HEADER_AND_DATA
A constant to define the algorithm used to determine the grid column widths, used in conjunction with the setColumnWidths() method.
|
static BBjNumber |
COLUMN_WIDTHS_FROM_WIDGET
A constant to define the algorithm used to determine the grid column widths, used in conjunction with the setColumnWidths() method.
|
BBjNumber |
ColumnHeaderHeight
A number that detmines the grid's column header height in pixels
|
BBjVector |
Columns!
A vector of columns indicating which fields in the BBjRecordSet will be used to provide data for the widget
|
BBjString |
ConnectString$
A JDBC connect string used to connect to the database
|
BBjFont |
Font!
A BBjFont that is applied to the underlying BBjGrid control, allowing customization of the font family, size, and style
|
BBjFont |
HeaderFont!
A BBjFont that is applied to the header in the underlying BBjGrid control, allowing customization of the font family, size, and style
|
static BBjNumber |
HORIZONTAL_ALIGNMENT_CENTER
A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable
|
static BBjNumber |
HORIZONTAL_ALIGNMENT_LEFT
A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable
|
static BBjNumber |
HORIZONTAL_ALIGNMENT_RIGHT
A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable
|
BBjNumber |
HorizontalAlignment
A number that determines the default horizontal alignment for cells in the grid.
|
BBjNumber |
HorizontalHeaderAlignment
A number that determines the default horizontal alignment for column header cells in the grid.
|
BBjNumber |
HorizontalScrollable
A number that determines whether the horizontal scrollbar will appear if there are more columns than can be displayed in the grid's client area.
|
static BBjNumber |
ON_GRID_REFRESH
Constant for widget refresh event.
|
BBjRecordSet |
RecordSet!
A BBjRecordSet used to provide data for the widget
|
BBjNumber |
RowHeight
A number that detmines the grid's row height in pixels
|
static BBjNumber |
SCROLL_BAR_SIZE
A constant to define the scroll bar width
|
BBjNumber |
ShouldHighlightSelectedRow
A number that acts as a boolean, determining whether the grid should highlight the selected row
|
BBjNumber |
SnapToRowHeight
A number that acts as a boolean, determining whether the grid should snap to the row height
|
BBjNumber |
SortByMultipleColumns
A number that acts as a boolean, determining whether the grid should sort by multiple columns
|
BBjString |
SQL$
A SQL query used to provide data for the widget
|
static BBjNumber |
VERTICAL_ALIGNMENT_BOTTOMT
A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable
|
static BBjNumber |
VERTICAL_ALIGNMENT_CENTER
A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable
|
static BBjNumber |
VERTICAL_ALIGNMENT_TOP
A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable
|
BBjNumber |
VerticalAlignment
A number that determines the default vertical alignment for cells in the grid.
|
BBjNumber |
VerticalScrollable
A number that determines whether the vertical scrollbar will appear if there are more rows than can be displayed in the grid's client area.
|
CustomObject |
WidgetRefreshCallbackObject!
Refresh event callback object.
|
BBjString |
WidgetRefreshCallbackRoutine!
Refresh event callback routine.
|
BBjString |
WidgetRefreshEventName!
Refresh event name.
|
BASIS_UTILITY_DEVICE_PIXEL_RATIO_KEY_NAME$, DevicePixelRatio!
BASIS_DASHBOARD_UTILITY_FILL_ERROR_ACTION_KEY_NAME$, CachedImage!, DashboardWidget!, FillErrorAction, ON_FILL_ERROR_IGNORE, ON_FILL_ERROR_STOP, ON_FILL_ERROR_WARN, UserData!
Constructor and Description |
---|
GridWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$)
Creates a GridWidget
|
GridWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjRecordSet p_rs!,
BBjVector p_columns!)
Creates a GridWidget with a BBjRecordSet which is used to automatically populate the grid with data
|
GridWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjString p_connectString$,
BBjString p_sql$)
Creates a GridWidget with a connection string and SQL query which are used to automatically populate the grid with data
|
GridWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjString p_connectString$,
BBjString p_sql$,
BBjString p_mode$)
Creates a GridWidget with a connection string and SQL query which are used to automatically populate the grid with data
|
GridWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjVector p_colHeaderData!,
BBjVector p_rowData!)
Creates a GridWidget providing the column header data and row data for the grid via BBjVectors
|
Modifier and Type | Method and Description |
---|---|
void |
clearColumnWidthPercentages()
Clears the grid widget's column width percentages HashMap
|
void |
clearDataSet()
Clears the widget's underlying dataset
|
GridWidget |
clone()
An internal method used by the Dashboard class to clone a category widget so that it may be displayed in a popped out window
|
void |
create(BBjChildWindow p_widgetControlWindow!)
Creates the GridWidget
|
void |
destroy()
Destroys the GridWidget
|
void |
email(BBjNumber p_parentX,
BBjNumber p_parentY,
BBjNumber p_parentWidth,
BBjNumber p_parentHeight)
Displays a dialog that facilitates emailing a screenshot of the grid as an attachment to one or more recipients
|
void |
exportData(BBjNumber p_parentX,
BBjNumber p_parentY,
BBjNumber p_parentWidth,
BBjNumber p_parentHeight)
Displays an export dialog that allows the user to export the widget's data to a CSV file with several output options
|
void |
fill(BBjRecordSet p_rs!,
BBjVector p_columns!)
Fills the grid's underlying dataset with data from BBjRecordSet and
BBjVector specifying the columns to use
|
void |
fill(BBjString p_connectString$,
BBjString p_sql$)
Fills the grid's underlying dataset with data from an SQL query
|
void |
fill(BBjString p_connectString$,
BBjString p_sql$,
BBjString p_mode$)
Fills the grid's underlying dataset with data from an SQL query and a mode string
|
void |
fill(BBjVector p_colHeaderData!,
BBjVector p_rowData!)
Fills the grid's underlying dataset with data with passed vectors
BBjVector specifying the columns to use
|
BBjString |
getCellText(BBjNumber p_row,
BBjNumber p_col)
Returns the text of a cell in the GridWidget given the cell's row and column number
|
BBjNumber |
getClickTarget(BBjNumber p_x,
BBjNumber p_y)
Returns a constant representing which part of the the GridWidget's that the user clicked
|
BBjVector |
getColumnHeaderData()
Returns the header data of the GridWidget in a BBjVector
|
BBjNumber |
getNumColumns()
Returns the number of columns in the GridWidget
|
BBjNumber |
getNumRows()
Returns the number of rows in the GridWidget
|
BBjVector |
getRowData()
Returns the data of the GridWidget in a BBjVector
|
BBjNumber |
getSelectedColumn()
Returns the currently selected column in the GridWidget
|
BBjNumber |
getSelectedRow()
Returns the currently selected row in the GridWidget
|
BBjVector |
getSelectedText()
Returns the text of the currently selected cells in the GridWidget via a BBjVector.
|
BBjVector |
getVectorsFromBBjRS(BBjRecordSet p_rs!,
BBjVector p_columns!)
Given a BBjRecordSet and a vector of columns, return vectors for the grid's column headers and data embedded in a return vector.
|
BBjVector |
getVectorsFromSQLQuery(BBjString p_connectString$,
BBjString p_sql$,
BBjString p_mode$)
Given an SQL query, return vectors for the grid's column headers and data embedded in a return vector.
|
BBjNumber |
isDestroyed()
Returns if the GridWidget is destroyed
|
BBjNumber |
isEmpty()
Indicates whether the widget's dataset is empty or not
|
BBjNumber |
isRecordSetBased()
Indicates whether the widget's dataset was built from a BBjRecordSet
|
BBjNumber |
isSQLBased()
Indicates whether the widget's dataset was built from an SQL query
|
void |
OnControlPopupRequest(BBjPopupRequestEvent p_event!)
An internal method that is called when the mouse is right-clicked over the GridWidget
|
void |
OnGridWidgetEvent(BBjSysGuiEvent p_event!)
An internal method that is called when the user initiates an event on a GridWidget for which a callback event has been registered
|
void |
refresh()
Refreshes the grid, which results in the widget showing an up-to-date version of the grid.
|
void |
resize(BBjNumber p_width,
BBjNumber p_height)
Resizes the widget using the provided with and height
|
void |
save()
Saves an image representation of the grid on the client's machine
|
void |
setAutoResizeColumns(BBjNumber p_autoResizeColumns)
A number acting as a boolean that determines whether the grid should size its columns to fit within the widget.
|
void |
setAutoResizeGrid(BBjNumber p_autoResizeGrid)
A number acting as a boolean that determines whether the grid should size its columns to fit its data.
|
void |
setCallback(BBjNumber p_event,
BBjString p_callbackRoutine$)
Sets a callback for a GridWidget event
|
void |
setCallback(BBjNumber p_event,
CustomObject p_callbackObject!,
BBjString p_callbackRoutine$)
Sets a callback for a GridWidget event
|
void |
setCellImage(BBjNumber p_row,
BBjNumber p_column,
BBjImage p_image!)
Sets a cell image in a cell of the grid.
|
void |
setClickTarget(BBjControl p_control!,
BBjNumber p_x,
BBjNumber p_y)
An internal method used by the Dashboard WidgetControl that sets the
ClickTarget field variable that indicates where the user last clicked on the GridWidget. |
void |
setClickTarget(BBjNumber p_x,
BBjNumber p_y)
An internal method used by the Dashboard WidgetControl that sets the
ClickTarget field variable that indicates where the user last clicked on the GridWidget. |
void |
setColumnAlignment(BBjNumber p_column,
BBjNumber p_alignment)
Sets the alignment of a grid's column
|
void |
setColumnBackColor(BBjNumber p_column,
BBjColor p_color!)
Sets the background color for the specified grid column.
|
void |
setColumnBackColors(BBjString p_colors!)
Sets the background colors for grid's columns given a fixed number of hex color descriptions in a string.
|
void |
setColumnForeColor(BBjNumber p_column,
BBjColor p_color!)
Sets the foreground color for the specified grid column.
|
void |
setColumnForeColors(BBjString p_colors!)
Sets the foreground colors for grid's columns given a fixed number of hex color descriptions in a string
|
void |
setColumnHeaderAlignment(BBjNumber p_column,
BBjNumber p_alignment)
Sets the alignment of a grid's column header
|
void |
setColumnHeaderAlignments(BBjNumber p_alignment)
Sets the alignment for all column headers in the grid
|
void |
setColumnHeaderCellImage(BBjNumber p_column,
BBjImage p_image!)
Sets an image in a column header of the grid.
|
void |
setColumnHeaderData(BBjVector p_colHeaderData!)
Sets the grid's column header data using the passed vector
|
void |
setColumnMask(BBjNumber p_column,
BBjString p_mask$)
Sets the output mask for the all cells in a grid's column, similar to CommonGrid::setColumnMask()
|
void |
setColumnStyle(BBjNumber p_column,
BBjNumber p_style)
Sets the control style of a grid's column, similar to CommonGrid::setColumnStyle()
|
void |
setColumnWidth(BBjNumber p_column,
BBjNumber p_width)
Sets the width of a grid's column
|
void |
setColumnWidthPercentages(BBjString p_columnWidthPercentages!)
Sets the widths of all grid columns by providing a string containing width percentages
|
void |
setColumnWidthPercentages(BBjVector p_columnWidthPercentages!)
Sets the widths of all grid columns by providing a vector containing width percentages
|
void |
setColumnWidths(BBjNumber p_columnWidthsConstant)
Sets the widths of the grid's columns based on an algorithm determined by the provided parameter.
|
void |
setHorizontalScrollable(BBjNumber p_horizontalScrollable)
Sets whether the grid will display a horizontal scrollbar.
|
void |
setRowData(BBjVector p_rowData!)
Sets the grid's row data using the passed vector
|
void |
viewData()
Exports the widget's data to a CSV file and displays it in the application associated with CSV files on the client's machine
|
display, getDevicePixelRatio, logQueryPerformance, setDevicePixelRatio
active, getClientSlash, getFillError, getFillErrorDesc, getImage, getImage, imageFileSaveDialog, logError, name, previewImage, previewText, setActive, setFillErrorDisplayImage, setFillErrorDisplayText, setLastSaveDir, spacesValid, title
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumns, getConnectString, getRecordSet, getSQL
public BBjString ConnectString$
public BBjString SQL$
public BBjRecordSet RecordSet!
public BBjVector Columns!
public BBjNumber AutoResizeColumns
public BBjNumber AutoResizeGrid
public BBjNumber RowHeight
public BBjNumber ColumnHeaderHeight
public BBjNumber AllColumnsUserSortable
public BBjNumber SortByMultipleColumns
public BBjNumber ShouldHighlightSelectedRow
public BBjNumber SnapToRowHeight
public BBjNumber VerticalAlignment
public BBjNumber HorizontalAlignment
public BBjNumber HorizontalHeaderAlignment
public BBjFont Font!
public BBjFont HeaderFont!
public static BBjNumber ON_GRID_REFRESH
public BBjString WidgetRefreshEventName!
public CustomObject WidgetRefreshCallbackObject!
public BBjString WidgetRefreshCallbackRoutine!
public BBjNumber HorizontalScrollable
public BBjNumber VerticalScrollable
public static BBjNumber COLUMN_WIDTHS_FROM_HEADER
public static BBjNumber COLUMN_WIDTHS_FROM_DATA
public static BBjNumber COLUMN_WIDTHS_FROM_HEADER_AND_DATA
public static BBjNumber COLUMN_WIDTHS_FROM_WIDGET
public static BBjNumber HORIZONTAL_ALIGNMENT_LEFT
public static BBjNumber HORIZONTAL_ALIGNMENT_RIGHT
public static BBjNumber HORIZONTAL_ALIGNMENT_CENTER
public static BBjNumber VERTICAL_ALIGNMENT_TOP
public static BBjNumber VERTICAL_ALIGNMENT_BOTTOMT
public static BBjNumber VERTICAL_ALIGNMENT_CENTER
public static BBjNumber CELL_STYLE_INPUTE
public static BBjNumber CELL_STYLE_CHECKED
public static BBjNumber CELL_STYLE_UNCHECKED
public static BBjNumber CELL_STYLE_TEXT
public static BBjNumber CELL_STYLE_INPUTN
public static BBjNumber CELL_STYLE_INPUTD
public static BBjNumber ClickTarget
public static BBjNumber CLICK_TARGET_CELL
public static BBjNumber CLICK_TARGET_COLUMN_HEADER
public static BBjNumber CLICK_TARGET_ROW_HEADER
public static BBjNumber CLICK_TARGET_SCROLLBAR
public static BBjNumber CLICK_TARGET_CORNER
public static BBjNumber SCROLL_BAR_SIZE
public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$)
p_name$
- The widget's namep_title$
- The widget's titlep_previewText$
- The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
- The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_connectString$, BBjString p_sql$)
p_name$
- The widget's namep_title$
- The widget's titlep_previewText$
- The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
- The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.p_connectString$
- The connection string to the desired database. Example: "jdbc:basis:localhost?database = ChileCompany&user = admin&password = admin123"p_sql$
- The sql query used to populate the chart. The three columns should be rowKey, colKey, value.public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)
p_name$
- The widget's namep_title$
- The widget's titlep_previewText$
- The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
- The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.p_connectString$
- The connection string to the desired database. Example: "jdbc:basis:localhost?database = ChileCompany&user = admin&password = admin123"p_sql$
- The sql query used to populate the chart. The three columns should be rowKey, colKey, value.p_mode$
- A string comprised of a list of properties and values separated by commas that will be passed to the database or JDBC connection at connect time. For example: "USER = myusername, PWD = mypass, AUTOCOMMIT = N"
public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjRecordSet p_rs!, BBjVector p_columns!)
p_name$
- The widget's namep_title$
- The widget's titlep_previewText$
- The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
- The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.p_rs!
- The BBjRecordSet containing the data used to populate the gridp_columns!
- The BBjVector that contains an ordered list of the columns to be used for the grid's data. The entries may be a string corresponding to a field name, or a 0-based index of the column number. If null() is passed in for the p_columns! vector then all columns of the BBjRecordSet will be used.public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjVector p_colHeaderData!, BBjVector p_rowData!)
p_name$
- The widget's namep_title$
- The widget's titlep_previewText$
- The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
- The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.p_colHeaderData!
- The widget's column header data, provided in a BBjVectorp_rowData!
- The widget's data, provided in a BBjVectorpublic GridWidget clone()
public BBjNumber isSQLBased()
public BBjNumber isRecordSetBased()
public BBjNumber isEmpty()
public void fill(BBjString p_connectString$, BBjString p_sql$)
fill
in interface DataFillableWidget
p_connectString$
- The connection string to the desired database. Example: "jdbc:basis:localhost?database = ChileCompany&user = admin&password = admin123"p_sql$
- The sql query used to populate the grid.public void fill(BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)
p_connectString$
- The connection string to the desired database. Example: "jdbc:basis:localhost?database = ChileCompany&user = admin&password = admin123"p_sql$
- The sql query used to populate the grid.p_mode$
- A string comprised of a list of properties and values separated by commas that will be passed to the database or JDBC connection at connect time. For example: "USER = myusername, PWD = mypass, AUTOCOMMIT = N"
public void fill(BBjRecordSet p_rs!, BBjVector p_columns!)
fill
in interface DataFillableWidget
p_rs!
- BBjRecordSet that contains the data.p_columns!
- BBjVector specifying the columns to use.public void fill(BBjVector p_colHeaderData!, BBjVector p_rowData!)
fill
in interface DataFillableWidget
p_colHeaderData!
- BBjVector containing the column header data.p_rowData!
- BBjVector containg the row data.public void clearDataSet()
clearDataSet
in interface DataFillableWidget
public void clearColumnWidthPercentages()
public void setColumnHeaderData(BBjVector p_colHeaderData!)
p_colHeaderData!
- BBjVector containing the column header data.public void setRowData(BBjVector p_rowData!)
p_rowData!
- BBjVector containing the row data.public void setColumnAlignment(BBjNumber p_column, BBjNumber p_alignment)
p_column
- 0-Based columnp_alignment
- Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()public void setColumnHeaderAlignment(BBjNumber p_column, BBjNumber p_alignment)
p_column
- 0-Based column headerp_alignment
- Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()public void setColumnHeaderAlignments(BBjNumber p_alignment)
p_alignment
- Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()public void setColumnStyle(BBjNumber p_column, BBjNumber p_style)
p_column
- 0-Based columnp_style
- Cell style constantpublic void setColumnMask(BBjNumber p_column, BBjString p_mask$)
p_column
- 0-Based columnp_mask$
- The mask for the contents of the cell. Cell styles of InputD, InputN, and InputE are all affected by masks. See the InputD, InputN, and InputE documentation for specific information on valid masks.public void setColumnWidth(BBjNumber p_column, BBjNumber p_width)
p_column
- 0-Based columnp_width
- Width in pixelspublic void setColumnWidthPercentages(BBjString p_columnWidthPercentages!)
p_columnWidthPercentages!
- A comma delimited string that contains percentage
values (out of 100) for each column in the grid. The total of all percentages should add up to 100 to avoid an error.public void setColumnWidthPercentages(BBjVector p_columnWidthPercentages!)
p_columnWidthPercentages!
- A BBjVector which contains percentage
values (out of 100) for each column in the grid. The total of all percentages should add up to 100 to avoid an error.public void setAutoResizeColumns(BBjNumber p_autoResizeColumns)
Note that this method is a shortcut to calling the setColumnWidths() method specifying the COLUMN_WIDTHS_FROM_WIDGET constant for the sizing algorithm. It's also an alternative sizing model to the AutoResizeGrid scheme. If all columns should fit in the widget without scrolling and it doesn't matter if the cell data is truncated, then set AutoResizeColumns. If it's more important to show all data without truncation and it doesn't matter if the user has to horizontally scroll the grid to see all columns then set AutoResizeGrid.
p_autoResizeColumns
- A number acting as a boolean that determines whether the grid should size its columns to fit within the widgetpublic void setAutoResizeGrid(BBjNumber p_autoResizeGrid)
Note that this method is a shortcut to calling the setColumnWidths() method specifying the COLUMN_WIDTHS_FROM_HEADER_AND_DATA constant for the sizing algorithm. It's also an alternative sizing model to the AutoResizeColumns scheme. If all columns should fit in the widget without scrolling and it doesn't matter if the cell data is truncated, then set AutoResizeColumns. If it's more important to show all data without truncation and it doesn't matter if the user has to horizontally scroll the grid to see all columns then set AutoResizeGrid.
p_autoResizeGrid
- A number acting as a boolean that determines whether the grid should size its columns to fit its datapublic void setColumnWidths(BBjNumber p_columnWidthsConstant)
Parameter options:
gridWidget!.setColumnWidths(gridWidget!.getCOLUMN_WIDTHS_FROM_HEADER_AND_DATA())
This code sizes the GridWidget's columns to be wide enough so that the grid's header text and cell text will not be truncated
and potentially results in a horizontally scrollable grid.
Calculating the column widths may add a nominal amount time to the GridWidget's refresh() routine, depending on how much text is processed
to determine the optimum width. Specifying the COLUMN_WIDTHS_FROM_HEADER constant should be the fastest given an average
grid, as the GridWidget does not have to measure many strings. However, specifying the COLUMN_WIDTHS_FROM_DATA will take
longer as the GridWidget measures several rows of data to determine the optimum width. The COLUMN_WIDTHS_FROM_HEADER_AND_DATA
parameter causes the GridWidget to measure both the header text and the text in the first few rows of data. It may not
be as accurate as COLUMN_WIDTHS_FROM_DATA, as it does not analyze all data in the interest of performance.p_columnWidthsConstant
- A constant (public field variable) in this class that determines how to calculate and size the column widthspublic void setColumnHeaderCellImage(BBjNumber p_column, BBjImage p_image!)
p_column
- 0-Based column.p_image!
- BBjImage to display in the column header.public void setColumnBackColor(BBjNumber p_column, BBjColor p_color!)
To more easily set the colors of multiple columns at once, see the setColumnBackColors() method.
p_column
- 0-Based column.p_color!
- The BBjColor to apply to the column's backgroundpublic void setColumnForeColor(BBjNumber p_column, BBjColor p_color!)
To more easily set the colors of multiple columns at once, see the setColumnForeColors() method.
p_column
- 0-Based column.p_color!
- The BBjColor to apply to the column's foreground textpublic void setColumnBackColors(BBjString p_colors!)
This is a convenience method to set the colors for multiple columns at once, compared to using the setColumnBackColor() method which sets the background color of a single, specified column.
p_colors!
- A comma delimited string of hex descriptions of the range of colors. Ex: "#000000, #ffcc00, #ffffff" which would set the colors of the grid's first three columns.public void setColumnForeColors(BBjString p_colors!)
This is a convenience method to set the colors for multiple columns at once, compared to using the setColumnForeColor() method which sets the foreground color of a single, specified column.
p_colors!
- A comma delimited string of hex descriptions of the range of colors. Ex: "#000000, #ffcc00, #ffffff" which would set the colors of the grid's first three columns.public void setHorizontalScrollable(BBjNumber p_horizontalScrollable)
p_horizontalScrollable
- A number that acts as a boolean, determining whether the grid should show a horizontal scrollbarpublic void setCellImage(BBjNumber p_row, BBjNumber p_column, BBjImage p_image!)
p_row
- 0-Based row.p_column
- 0-Based column.p_image!
- BBjImage to display in the cell.public void setCallback(BBjNumber p_event, BBjString p_callbackRoutine$)
p_event
- Indicates the event registering for, such as GridWidget.getON_GRID_INIT() or GridWidget.getON_GRID_REFRESH().p_callbackRoutine$
- Routine to call when the event is triggeredpublic void setCallback(BBjNumber p_event, CustomObject p_callbackObject!, BBjString p_callbackRoutine$)
p_event
- Indicates the event registering for, such as GridWidget.getON_GRID_INIT() or GridWidget.getON_GRID_REFRESH().p_callbackObject!
- CustomObject that contains the routine to call when the event is triggeredp_callbackRoutine$
- Routine to call when the event is triggeredpublic void create(BBjChildWindow p_widgetControlWindow!)
public void refresh()
refresh
in interface RefreshableWidget
public void resize(BBjNumber p_width, BBjNumber p_height)
public void OnGridWidgetEvent(BBjSysGuiEvent p_event!)
public void OnControlPopupRequest(BBjPopupRequestEvent p_event!)
This method exists so that a custom popup menu will be displayed instead of the default browser's popup menu. The method is technically a no-op, but needs to exist as we need to register for the window's ON_POPUP_REQUEST event in order to prevent the browser from displaying its own popup menu when running in BUI.
p_event!
- BBjPopupRequestEvent that contains event informationpublic void destroy()
public BBjNumber isDestroyed()
isDestroyed
in interface Widget
isDestroyed
in class BBjWidget
public void save()
save
in interface SaveableWidget
public void email(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight)
email
in interface EmailableWidget
p_parentX
- X location of the parent windowp_parentY
- Y location of the parent windowp_parentWidth
- Width of the parent windowp_parentHeight
- Height of the parent windowpublic void viewData()
viewData
in interface DataFillableWidget
public void exportData(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight)
exportData
in interface DataFillableWidget
p_parentX
- X location of the parent windowp_parentY
- Y location of the parent windowp_parentWidth
- Width of the parent windowp_parentHeight
- Height of the parent windowpublic BBjVector getVectorsFromSQLQuery(BBjString p_connectString$, BBjString p_sql$, BBjString p_mode$)
This is an internal method used by the widget class
p_connectString$
- The connection string to the desired database. Example: "jdbc:basis:localhost?database = ChileCompany&user = admin&password = admin123"p_sql$
- The sql query used to populate the grid.public BBjNumber getNumRows()
public BBjNumber getNumColumns()
public BBjVector getRowData()
public BBjVector getColumnHeaderData()
public BBjNumber getSelectedColumn()
public BBjNumber getSelectedRow()
public BBjString getCellText(BBjNumber p_row, BBjNumber p_col)
p_row
- The cell's zero-based row numberp_col
- The cell's zero-based column numberpublic BBjVector getSelectedText()
Each index in the vector corresponds to the similarly numbered column in the BBjGrid.
public BBjNumber getClickTarget(BBjNumber p_x, BBjNumber p_y)
This method can be used to tell if the user clicked on a grid cell, header, or scrollbar component of the grid. It's possible to use this information to do different actions, for example a click on a cell can be used to cause the widget to drill down based on the selected cell, but a click on the header can be used to refresh the grid.
p_x
- - The X coordinate of the click eventp_y
- - The Y coordinate of the click eventpublic void setClickTarget(BBjNumber p_x, BBjNumber p_y)
ClickTarget
field variable that indicates where the user last clicked on the GridWidget.p_x
- - The X coordinate of the click eventp_y
- - The Y coordinate of the click eventpublic void setClickTarget(BBjControl p_control!, BBjNumber p_x, BBjNumber p_y)
ClickTarget
field variable that indicates where the user last clicked on the GridWidget.p_control
- The BBjControl that originated the click eventp_x
- The X coordinate of the click eventp_y
- The Y coordinate of the click eventpublic BBjVector getVectorsFromBBjRS(BBjRecordSet p_rs!, BBjVector p_columns!)
This is an internal method used by the widget class
p_rs!
- The BBjRecordSet containing the data used to populate the chartp_columns!
- A BBjVector that contains an ordered list of the columns to be used for the charts's data. The entries may be a string corresponding to a field name, or a 0-based index of the column number. If null() is passed in for the p_columns! vector then the first three columns of the BBjRecordSet will be used.