public class GridWidget extends BBjWidget implements DataFillableWidget,
GridWidget A Dashboard Utility Widget that displays data in a grid
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. Setting AutoResizeColumns sizes the grid and columns to fit in the widget, potentially truncating the data if the widget is small. The default is 1. |
BBjNumber | AutoResizeGrid A number acting as a boolean that determines whether the grid should size its columns to fit its data. Setting AutoResizeGrid sizes the grid and columns fit the data, potentially making it necessary to scroll the grid to see all the data. The default is 0. |
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. Top left corner adjacent to column and row headers. |
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. This is currently only valid in BUI. |
static BBjNumber | ClickTarget A number representing where the user last clicked on the GridWidget. This method can be used to tell if the user clicked on a grid cell, header, scrollbar, or corner 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. |
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. This causes the columns to be wide enough to fit the grid's cell data. |
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. This causes the columns to be wide enough to fit the grid's header text. |
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. This causes the columns to be wide enough to fit the grid's header text and cell data. |
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. This causes all columns to fit within the widget without requiring a horizontal scrollbar. |
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. The default value is BBjGrid.GRID_ALIGN_CENTER |
BBjNumber | HorizontalHeaderAlignment A number that determines the default horizontal alignment for column header cells in the grid. The default value is BBjGrid.GRID_ALIGN_CENTER. |
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. The default value is 0. |
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. The default value is BBjGrid.CENTER_ALIGNMENT |
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. The default value is 1. |
CustomObject | WidgetRefreshCallbackObject! Refresh event callback object. |
BBjString | WidgetRefreshCallbackRoutine! Refresh event callback routine. |
BBjString | WidgetRefreshEventName! Refresh event name. |
BASIS_DASHBOARD_UTILITY_FILL_ERROR_ACTION_KEY_NAME$, CachedImage!, DashboardWidget!, FillErrorAction, ON_FILL_ERROR_IGNORE, ON_FILL_ERROR_STOP, ON_FILL_ERROR_WARN, UserData! Fields inherited from class BBjWidget
BASIS_UTILITY_DEVICE_PIXEL_RATIO_KEY_NAME$, DevicePixelRatio!
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$, 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$, 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$, BBjVector p_colHeaderData!, BBjVector p_rowData!) Creates a GridWidget providing the column header data and row data for the grid via BBjVectors |
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 |
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(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(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(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 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. |
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. Each index in the vector corresponds to the similarly numbered column in the BBjGrid. |
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. This is an internal method used by the widget class |
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. This is an internal method used by the widget class |
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 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. |
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. This is executed in response to a refresh event, and the grid is filled with curent data and all customizations are applied. |
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. Setting AutoResizeColumns sizes the grid and columns to fit in the widget, potentially truncating the data if the widget is small. The default is 1. 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. |
void | setAutoResizeGrid(BBjNumber p_autoResizeGrid) A number acting as a boolean that determines whether the grid should size its columns to fit its data. Setting AutoResizeGrid sizes the grid and columns fit the data, potentially making it necessary to scroll the grid to see all data. The default is 0. 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. |
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(BBjNumber p_x, BBjNumber p_y) An internal method used by the Dashboard WidgetControl that sets the |
void | setClickTarget(BBjControl p_control!, BBjNumber p_x, BBjNumber p_y) An internal method used by the Dashboard WidgetControl that sets the |
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. To more easily set the colors of multiple columns at once, see the setColumnBackColors() method. |
void | setColumnBackColors(BBjString p_colors!) Sets the background colors for grid's columns given a fixed number of hex color descriptions in a string. 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. |
void | setColumnForeColor(BBjNumber p_column, BBjColor p_color!) Sets the foreground color for the specified grid column. To more easily set the colors of multiple columns at once, see the setColumnForeColors() method. |
void | setColumnForeColors(BBjString p_colors!) Sets the foreground colors for grid's columns given a fixed number of hex color descriptions in a string 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. |
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. Parameter options:
This method explicity sets the grid's columns based on the provided parameter. It provides ultimate control over how the grid's columns are sized and is an alternative to setting AutoResizeGrid or AutoResizeColumns. An example use case would be:
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. |
void | setHorizontalScrollable(BBjNumber p_horizontalScrollable) Sets whether the grid will display a horizontal scrollbar. Turning on a horizontal scrollbar also has the effect of turning off the AutoResizeColumns options as the two configurations are mutually exclusive. |
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 |
active, destroy, getClientSlash, getFillError, getFillErrorDesc, getImage, getImage, imageFileSaveDialog, isDestroyed, logError, name, previewImage, previewText, setActive, setFillErrorDisplayImage, setFillErrorDisplayText, setLastSaveDir, spacesValid, title
create, destroy, display, getDevicePixelRatio, isDestroyed, logQueryPerformance, resize, setDevicePixelRatio
public BBjNumber AllColumnsUserSortable
A number that acts as a boolean, determining whether the grid should configure all columns to be sortable
public BBjNumber AutoResizeColumns
A number acting as a boolean that determines whether the grid should size its columns to fit the widget. Setting AutoResizeColumns sizes the grid and columns to fit in the widget, potentially truncating the data if the widget is small. The default is 1.
public BBjNumber AutoResizeGrid
A number acting as a boolean that determines whether the grid should size its columns to fit its data. Setting AutoResizeGrid sizes the grid and columns fit the data, potentially making it necessary to scroll the grid to see all the data. The default is 0.
public static BBjNumber CELL_STYLE_CHECKED
A constant to define grid column style, used in conjunction with the setColumnStyle() method
public static BBjNumber CELL_STYLE_INPUTD
A constant to define grid column style, used in conjunction with the setColumnStyle() method
public static BBjNumber CELL_STYLE_INPUTE
A constant to define grid column style, used in conjunction with the setColumnStyle() method
public static BBjNumber CELL_STYLE_INPUTN
A constant to define grid column style, used in conjunction with the setColumnStyle() method
public static BBjNumber CELL_STYLE_TEXT
A constant to define grid column style, used in conjunction with the setColumnStyle() method
public static BBjNumber CELL_STYLE_UNCHECKED
A constant to define grid column style, used in conjunction with the setColumnStyle() method
public static BBjNumber CLICK_TARGET_CELL
A constant to define where the user clicked on the grid.
BBj 18.00
public static BBjNumber CLICK_TARGET_COLUMN_HEADER
A constant to define where the user clicked on the grid.
BBj 18.00
public static BBjNumber CLICK_TARGET_CORNER
A constant to define where the user clicked on the grid. Top left corner adjacent to column and row headers.
BBj 18.00
public static BBjNumber CLICK_TARGET_ROW_HEADER
A constant to define where the user clicked on the grid.
BBj 18.00
public static BBjNumber CLICK_TARGET_SCROLLBAR
A constant to define where the user clicked on the grid. This is currently only valid in BUI.
BBj 18.00
public static BBjNumber ClickTarget
A number representing where the user last clicked on the GridWidget. This method can be used to tell if the user clicked on a grid cell, header, scrollbar, or corner 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.
BBj 18.00
public 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. This causes the columns to be wide enough to fit the grid's cell data.
BBj 16.20
public 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. This causes the columns to be wide enough to fit the grid's header text.
BBj 16.20
public 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. This causes the columns to be wide enough to fit the grid's header text and cell data.
BBj 16.20
public 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. This causes all columns to fit within the widget without requiring a horizontal scrollbar.
BBj 16.20
public BBjNumber ColumnHeaderHeight
A number that detmines the grid's column header height in pixels
public BBjVector Columns!
A vector of columns indicating which fields in the BBjRecordSet will be used to provide data for the widget
public BBjString ConnectString$
A JDBC connect string used to connect to the database
public BBjFont Font!
A BBjFont that is applied to the underlying BBjGrid control, allowing customization of the font family, size, and style
public BBjFont HeaderFont!
A BBjFont that is applied to the header in the underlying BBjGrid control, allowing customization of the font family, size, and style
public static BBjNumber HORIZONTAL_ALIGNMENT_CENTER
A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable
public static BBjNumber HORIZONTAL_ALIGNMENT_LEFT
A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable
public static BBjNumber HORIZONTAL_ALIGNMENT_RIGHT
A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable
public BBjNumber HorizontalAlignment
A number that determines the default horizontal alignment for cells in the grid. The default value is BBjGrid.GRID_ALIGN_CENTER
public BBjNumber HorizontalHeaderAlignment
A number that determines the default horizontal alignment for column header cells in the grid. The default value is BBjGrid.GRID_ALIGN_CENTER.
BBj 16.20
public 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. The default value is 0.
BBj 16.20
public static BBjNumber ON_GRID_REFRESH
Constant for widget refresh event.
BBj 18.00
public BBjRecordSet RecordSet!
A BBjRecordSet used to provide data for the widget
public BBjNumber RowHeight
A number that detmines the grid's row height in pixels
public static BBjNumber SCROLL_BAR_SIZE
A constant to define the scroll bar width
public BBjNumber ShouldHighlightSelectedRow
A number that acts as a boolean, determining whether the grid should highlight the selected row
public BBjNumber SnapToRowHeight
A number that acts as a boolean, determining whether the grid should snap to the row height
public BBjNumber SortByMultipleColumns
A number that acts as a boolean, determining whether the grid should sort by multiple columns
public BBjString SQL$
A SQL query used to provide data for the widget
public static BBjNumber VERTICAL_ALIGNMENT_BOTTOMT
A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable
public static BBjNumber VERTICAL_ALIGNMENT_CENTER
A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable
public static BBjNumber VERTICAL_ALIGNMENT_TOP
A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable
public BBjNumber VerticalAlignment
A number that determines the default vertical alignment for cells in the grid. The default value is BBjGrid.CENTER_ALIGNMENT
public 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. The default value is 1.
BBj 16.20
public CustomObject WidgetRefreshCallbackObject!
Refresh event callback object.
BBj 18.00
public BBjString WidgetRefreshCallbackRoutine!
Refresh event callback routine.
BBj 18.00
public BBjString WidgetRefreshEventName!
Refresh event name.
BBj 18.00
public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$)
Creates a GridWidget
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$)
Creates a GridWidget with a connection string and SQL query which are used to automatically populate the grid with data
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$, BBjRecordSet p_rs!, BBjVector p_columns!)
Creates a GridWidget with a BBjRecordSet which is used to automatically populate the grid with data
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. BBjRecordSet
BBjVector
public 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
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(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
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 void clearColumnWidthPercentages()
Clears the grid widget's column width percentages HashMap
public void clearDataSet()
Clears the widget's underlying dataset
public 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
public void create(BBjChildWindow p_widgetControlWindow!)
Creates the GridWidget
p_widgetControlWindow!
The BBjChildWindow that will contain the widgetpublic void destroy()
Destroys the GridWidget
public 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
public 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
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 fill(BBjString p_connectString$, BBjString p_sql$)
Fills the grid's underlying dataset with data from an SQL query
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$)
Fills the grid's underlying dataset with data from an SQL query and a mode string
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"
BBj 16.00
public 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
p_rs!
BBjRecordSet that contains the data.p_columns!
BBjVector specifying the columns to use.public 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
p_colHeaderData!
BBjVector containing the column header data.p_rowData!
BBjVector containg the row data.public 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
p_row
The cell's zero-based row numberp_col
The cell's zero-based column numberpublic BBjNumber getClickTarget(BBjNumber p_x, BBjNumber p_y)
Returns a constant representing which part of the the GridWidget's that the user clicked
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 event 18.00
public BBjVector getColumnHeaderData()
Returns the header data of the GridWidget in a BBjVector
public BBjNumber getNumColumns()
Returns the number of columns in the GridWidget
public BBjNumber getNumRows()
Returns the number of rows in the GridWidget
public BBjVector getRowData()
Returns the data of the GridWidget in a BBjVector
public BBjNumber getSelectedColumn()
Returns the currently selected column in the GridWidget
public BBjNumber getSelectedRow()
Returns the currently selected row in the GridWidget
public BBjVector getSelectedText()
Returns the text of the currently selected cells in the GridWidget via a BBjVector.
Each index in the vector corresponds to the similarly numbered column in the BBjGrid.
public 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.
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.public 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.
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 isDestroyed()
Returns if the GridWidget is destroyed
public BBjNumber isEmpty()
Indicates whether the widget's dataset is empty or not
BBj 16.00
public BBjNumber isRecordSetBased()
Indicates whether the widget's dataset was built from a BBjRecordSet
public BBjNumber isSQLBased()
Indicates whether the widget's dataset was built from an SQL query
public void OnControlPopupRequest(BBjPopupRequestEvent p_event!)
An internal method that is called when the mouse is right-clicked over the GridWidget
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 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
BBj 18.00
public void refresh()
Refreshes the grid, which results in the widget showing an up-to-date version of the grid. This is executed in response to a refresh event, and the grid is filled with curent data and all customizations are applied.
public void resize(BBjNumber p_width, BBjNumber p_height)
Resizes the widget using the provided with and height
p_width
Width of the widgetp_height
Height of the widgetpublic void save()
Saves an image representation of the grid on the client's machine
public 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. Setting AutoResizeColumns sizes the grid and columns to fit in the widget, potentially truncating the data if the widget is small. The default is 1.
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)
A number acting as a boolean that determines whether the grid should size its columns to fit its data. Setting AutoResizeGrid sizes the grid and columns fit the data, potentially making it necessary to scroll the grid to see all data. The default is 0.
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 data BBj 16.20
public void setCallback(BBjNumber p_event, BBjString p_callbackRoutine$)
Sets a callback for a GridWidget event
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 triggered BBj 18.00
public void setCallback(BBjNumber p_event, CustomObject p_callbackObject!, BBjString p_callbackRoutine$)
Sets a callback for a GridWidget event
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 triggered BBj 18.00
public void setCellImage(BBjNumber p_row, BBjNumber p_column, BBjImage p_image!)
Sets a cell image in a cell of the grid.
p_row
0-Based row.p_column
0-Based column.p_image!
BBjImage to display in the cell.public 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.
p_x
- The X coordinate of the click eventp_y
- The Y coordinate of the click event 18.00
public 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.
p_control
The BBjControl that originated the click eventp_x
The X coordinate of the click eventp_y
The Y coordinate of the click event 18.20
public void setColumnAlignment(BBjNumber p_column, BBjNumber p_alignment)
Sets the alignment of a grid's column
p_column
0-Based columnp_alignment
Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()public void setColumnBackColor(BBjNumber p_column, BBjColor p_color!)
Sets the background color for the specified grid column.
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 background BBj 18.00
public void setColumnBackColors(BBjString p_colors!)
Sets the background colors for grid's columns given a fixed number of hex color descriptions in a string.
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. BBj 18.00
public void setColumnForeColor(BBjNumber p_column, BBjColor p_color!)
Sets the foreground color for the specified grid column.
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 text BBj 18.00
public void setColumnForeColors(BBjString p_colors!)
Sets the foreground colors for grid's columns given a fixed number of hex color descriptions in a string
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. BBj 18.00
public void setColumnHeaderAlignment(BBjNumber p_column, BBjNumber p_alignment)
Sets the alignment of a grid's column header
p_column
0-Based column headerp_alignment
Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT() BBj 16.20
public void setColumnHeaderAlignments(BBjNumber p_alignment)
Sets the alignment for all column headers in the grid
p_alignment
Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT() BBj 16.20
public void setColumnHeaderCellImage(BBjNumber p_column, BBjImage p_image!)
Sets an image in a column header of the grid.
p_column
0-Based column.p_image!
BBjImage to display in the column header.public void setColumnHeaderData(BBjVector p_colHeaderData!)
Sets the grid's column header data using the passed vector
p_colHeaderData!
BBjVector containing the column header data.public 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()
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 setColumnStyle(BBjNumber p_column, BBjNumber p_style)
Sets the control style of a grid's column, similar to CommonGrid::setColumnStyle()
p_column
0-Based columnp_style
Cell style constantpublic void setColumnWidth(BBjNumber p_column, BBjNumber p_width)
Sets the width of a grid's column
p_column
0-Based columnp_width
Width in pixelspublic void setColumnWidthPercentages(BBjString p_columnWidthPercentages!)
Sets the widths of all grid columns by providing a string containing width percentages
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!)
Sets the widths of all grid columns by providing a vector containing width percentages
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 setColumnWidths(BBjNumber p_columnWidthsConstant)
Sets the widths of the grid's columns based on an algorithm determined by the provided parameter.
Parameter options:
This method explicity sets the grid's columns based on the provided parameter. It provides ultimate control over how the grid's columns are sized and is an alternative to setting AutoResizeGrid or AutoResizeColumns.
An example use case would be:
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 widths BBj 16.20
public void setHorizontalScrollable(BBjNumber p_horizontalScrollable)
Sets whether the grid will display a horizontal scrollbar. Turning on a horizontal scrollbar also has the effect of turning off the AutoResizeColumns options as the two configurations are mutually exclusive.
p_horizontalScrollable
A number that acts as a boolean, determining whether the grid should show a horizontal scrollbar BBj 16.20
public void setRowData(BBjVector p_rowData!)
Sets the grid's row data using the passed vector
p_rowData!
BBjVector containing the row data.public 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