public class GridExWidget extends BaseWidget implements DataFillableWidget, SaveableWidget, EmailableWidget, RefreshableWidget
The GridExWidget is based on the BBjGridExWidget plug-in which is a fast, full-featured grid that offers filtering, grouping, pinning, pivoting, and rules-based styling.
Modifier and Type | Field and Description |
---|---|
BBjVector |
Columns!
A developer-provided vector of columns indicating which fields in the BBjRecordSet will be used to provide data for the widget
|
BBjString |
ConnectString$
A developer-provided JDBC connect string used to connect to the database
|
BBjNumber |
Filterable
A number acting as a boolean that determines whether the grid enables filtering by columns
|
BBjNumber |
FilterableFloating
A number acting as a boolean that determines whether the grid enables filtering by columns via a floating filter
|
BBjNumber |
FitToGrid
A number acting as a boolean that determines whether the columns will fit inside the grid or if the grid will be horizontally scrollable - note that when FitToGrid is enabled, the columns will be sized to take up the full width of the grid but they may all be the same width.
|
BBjFont |
Font!
A BBjFont that is applied to the underlying BBjGrid control, allowing customization of the font family, size, and style - note that the font information is translated into CSS for the underlying BBjGridExWidget
|
BBjFont |
HeaderFont!
A BBjFont that is applied to the header in the underlying BBjGrid control, allowing customization of the font family, size, and style - note that the font information is translated into CSS for the underlying BBjGridExWidget
|
static BBjNumber |
HORIZONTAL_ALIGNMENT_CENTER
A constant to define grid cell horizontal alignment, used in conjunction with the setColumnAlignment(), setColumnHeaderAlignment(), and pinColumn() methods
|
static BBjNumber |
HORIZONTAL_ALIGNMENT_LEFT
A constant to define grid cell horizontal alignment, used in conjunction with the setColumnAlignment(), setColumnHeaderAlignment(), and pinColumn() methods
|
static BBjNumber |
HORIZONTAL_ALIGNMENT_RIGHT
A constant to define grid cell horizontal alignment, used in conjunction with the setColumnAlignment(), setColumnHeaderAlignment(), and pinColumn() methods
|
BBjRecordSet |
RecordSet!
A developer-provided BBjRecordSet used to provide data for the widget
|
BBjString |
SQL$
A developer-provided SQL query used to provide data for the widget
|
BBjString |
Theme!
The grid's theme where the default is a custom 'BBjGrid' emulation and other values are 'balham', 'material', 'fresh', 'blue', 'dark', and 'bootstrap' - note that setting a theme may invalidate other parameters, e.g.
|
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 |
---|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$)
Creates an empty GridExWidget to be filled later with one of the fill() methods
|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjRecordSet p_rs!,
BBjVector p_columns!)
Creates a GridExWidget with a BBjRecordSet for the row data and an (optionally null()) BBjVector for the column header data which are used to automatically populate the grid with data
|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjString p_connectString$,
BBjString p_sql$)
Creates a GridExWidget with a connection string and SQL query which are used to automatically populate the grid with data
|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjString p_connectString$,
BBjString p_sql$,
BBjString p_mode$)
Creates a GridExWidget with a connection string, SQL query, and mode which are used to automatically populate the grid with data
|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjString p_file$,
BBjString p_template$,
DataRow p_filter!)
Creates a GridExWidget that is filled using the BASIS Components to build a ResultSet based off of a data file, string template, and filter
|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
BBjVector p_colHeaderData!,
BBjVector p_rowData!)
Creates a GridExWidget providing the column header data and row data for the grid via BBjVectors
|
GridExWidget(BBjString p_name$,
BBjString p_title$,
BBjString p_previewText$,
BBjString p_previewImage$,
ResultSet p_resultSet!)
Creates a GridExWidget that is filled with a BASIS Components ResultSet
|
Modifier and Type | Method and Description |
---|---|
void |
clearDataSet()
Clears the widget's underlying dataset
|
GridExWidget |
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!)
Called to create the widget
|
void |
destroy()
Destroys the GridExWidget
|
void |
display(BBjNumber p_display)
Sets the widget's visibility
|
void |
exportData(BBjNumber p_parentX,
BBjNumber p_parentX,
BBjNumber p_parentWidth,
BBjNumber p_parentHeight)
Called to display a export dialog in order to export widget data
|
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(BBjString p_file$,
BBjString p_template$,
DataRow p_filter!)
Fills the grid's underlying dataset from an MKEYED, XKEYED, or VKEYED file, a string template describing the records in the file, and an optional DataRow to filter the data
Note: You can pass in a null() for the DataRow filter to get all records.
|
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
|
void |
fill(ResultSet p_resultSet!)
Fills the grid's underlying dataset with a BASIS Components ResultSet
|
BBjVector |
getColumnHeaderData()
Returns the header data of the GridWidget in a BBjVector
|
BBjGridExWidget |
getGrid()
Returns the GridExWidget's underlying BBjGridExWidget, but only after it has been created (meaning that it would only be available in response to a callback event)
|
BBjNumber |
getNumColumns()
Returns the number of columns in the GridExWidget
|
BBjNumber |
getNumRows()
Returns the number of rows in the GridExWidget
|
BBjGridExWidget |
getResultSet()
Returns the GridExWidget's underlying BASIS Components ResultSet
|
ResultSet |
getResultSetFromBBjRS(BBjRecordSet p_rs!,
BBjVector p_columns!)
Returns a BASIS Components ResultSet filled with data given a BBjRecordSet and a vector of columns
|
ResultSet |
getResultSetFromSQLQuery(BBjString p_connectString$,
BBjString p_sql$,
BBjString p_mode$)
Returns a BASIS Components ResultSet filled with data given a connect string and SQL query
|
ResultSet |
getResultSetFromVectors(BBjVector p_colHeaderData!,
BBjVector p_rowData!)
Returns a BASIS Components ResultSet filled with data given BBjVectors for the column header data and row data
|
BBjVector |
getRowData()
Returns the data of the GridWidget in a BBjVector
|
BBjNumber |
isDestroyed()
Returns if the GridExWidget 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
|
BBjNumber |
isVectorBased()
Indicates whether the widget's dataset was built from BBjVectors for the column header and row data
|
void |
pinColumn(BBjNumber p_column,
BBjNumber p_side)
Pins a column in the grid to the left or right margin
|
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 |
setColumnAlignment(BBjNumber p_column,
BBjNumber p_alignment)
Sets the alignment of a grid's 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 |
setColumnHeaderData(BBjVector p_colHeaderData!)
Sets the grid's column header data using the passed vector, providing a way to override the default column header text in the grid with custom strings
|
void |
setColumnHeaderHeight(BBjNumber p_height)
Sets the row height for the grid's header cells
|
void |
setColumnWidth(BBjNumber p_column,
BBjNumber p_width)
Sets the width of a grid's column given the 0-based column index
|
void |
setColumnWidthPercentages(BBjString p_columnWidthPercentages!)
Sets the widths of all grid columns by providing a string containing width percentages - note that sizing columns in this manner works best, especially when the widget is popped out and resized.
|
void |
setColumnWidthPercentages(BBjVector p_columnWidthPercentages!)
Sets the widths of all grid columns by providing a vector containing width percentages - note that sizing columns in this manner works best, especially when the widget is popped out and resized.
|
void |
setRowHeight(BBjNumber p_height)
Sets the row height for the grid's body cells
|
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, 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
save
email
public BBjString ConnectString$
public BBjString SQL$
public BBjRecordSet RecordSet!
public BBjVector Columns!
public BBjNumber FitToGrid
public BBjNumber Filterable
public BBjNumber FilterableFloating
public BBjString Theme!
public BBjFont Font!
public BBjFont HeaderFont!
public static BBjNumber HORIZONTAL_ALIGNMENT_LEFT
public static BBjNumber HORIZONTAL_ALIGNMENT_RIGHT
public static BBjNumber HORIZONTAL_ALIGNMENT_CENTER
public GridExWidget(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 GridExWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, ResultSet p_resultSet!)
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_resultSet!
- The BASIS Components ResultSet that contains the data for the widgetpublic GridExWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_file$, BBjString p_template$, DataRow p_filter!)
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_file$
- The the name of the MKEYED, XKEYED, or VKEYED file that contains the data for the widgetp_template$
- The string template describing the records in the filep_filter!
- The DataRow that acts as a filter when retrieving datapublic GridExWidget(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 gridpublic GridExWidget(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 GridExWidget(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 GridExWidget(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 GridExWidget clone()
public void create(BBjChildWindow p_widgetControlWindow!)
public void display(BBjNumber p_display)
public void resize(BBjNumber p_width, BBjNumber p_height)
public void refresh()
refresh
in interface RefreshableWidget
public void fill(ResultSet p_resultSet!)
p_resultSet!
- The BASIS Components ResultSet that contains the data for the widgetpublic void fill(BBjString p_file$, BBjString p_template$, DataRow p_filter!)
filter! = new DataRow()
filter!.setFieldValue("FILTER_KNUM", "1")
filter!.setFieldValue("FILTER_RANGE_FROM", "000002")
filter!.setFieldValue("FILTER_RANGE_TO", "000010")
p_file$
- The the name of the MKEYED, XKEYED, or VKEYED file that contains the data for the widgetp_template$
- The string template describing the records in the filep_filter!
- The DataRow that acts as a filter when retrieving datapublic 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 BBjNumber isSQLBased()
public BBjNumber isRecordSetBased()
public BBjNumber isVectorBased()
public BBjNumber isEmpty()
public void destroy()
destroy
in interface Widget
destroy
in class BaseWidget
public BBjNumber isDestroyed()
isDestroyed
in interface Widget
isDestroyed
in class BaseWidget
public void pinColumn(BBjNumber p_column, BBjNumber p_side)
p_column
- The 0-based index of the column to be pinnedp_side
- The side of the grid to which the column should be pinned. Valid options are GridExWidget.getHORIZONTAL_ALIGNMENT_LEFT() and GridExWidget.getHORIZONTAL_ALIGNMENT_RIGHT()public BBjGridExWidget getGrid()
public BBjGridExWidget getResultSet()
public BBjNumber getNumRows()
public BBjNumber getNumColumns()
public BBjVector getRowData()
public BBjVector getColumnHeaderData()
public void setRowHeight(BBjNumber p_height)
p_height
- Height in pixelspublic void setColumnHeaderHeight(BBjNumber p_height)
p_height
- Height in pixelspublic 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 setColumnAlignment(BBjNumber p_column, BBjNumber p_alignment)
p_column
- 0-Based columnp_alignment
- Alignment constant based off of the field variable, such as GridExWidget.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 GridExWidget.getHORIZONTAL_ALIGNMENT_LEFT()public void setColumnHeaderAlignments(BBjNumber p_alignment)
p_alignment
- Alignment constant based off of the field variable, such as GridExWidget.getHORIZONTAL_ALIGNMENT_LEFT()public void setColumnHeaderData(BBjVector p_colHeaderData!)
p_colHeaderData!
- BBjVector containing the column header data.public ResultSet getResultSetFromBBjRS(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 ResultSetp_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 ResultSet getResultSetFromSQLQuery(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 ResultSetpublic ResultSet getResultSetFromVectors(BBjVector p_colHeaderData!, BBjVector p_rowData!)
This is an internal method used by the widget class
p_colHeaderData!
- BBjVector which contains the column header datap_rowData!
- BBjVector which contains the row datapublic void clearDataSet()
clearDataSet
in interface DataFillableWidget
public void viewData()
viewData
in interface DataFillableWidget
public void exportData(BBjNumber p_parentX, BBjNumber p_parentX, 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 window