Skip navigation links
Dashboard

Class GridWidget

Inheritance:
  • Field Detail

    • AllColumnsUserSortable

      public BBjNumber AllColumnsUserSortable

      A number that acts as a boolean, determining whether the grid should configure all columns to be sortable

    • AutoResizeColumns

      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.

    • AutoResizeGrid

      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.

    • CELL_STYLE_CHECKED

      public static BBjNumber CELL_STYLE_CHECKED

      A constant to define grid column style, used in conjunction with the setColumnStyle() method

    • CELL_STYLE_INPUTD

      public static BBjNumber CELL_STYLE_INPUTD

      A constant to define grid column style, used in conjunction with the setColumnStyle() method

    • CELL_STYLE_INPUTE

      public static BBjNumber CELL_STYLE_INPUTE

      A constant to define grid column style, used in conjunction with the setColumnStyle() method

    • CELL_STYLE_INPUTN

      public static BBjNumber CELL_STYLE_INPUTN

      A constant to define grid column style, used in conjunction with the setColumnStyle() method

    • CELL_STYLE_TEXT

      public static BBjNumber CELL_STYLE_TEXT

      A constant to define grid column style, used in conjunction with the setColumnStyle() method

    • CELL_STYLE_UNCHECKED

      public static BBjNumber CELL_STYLE_UNCHECKED

      A constant to define grid column style, used in conjunction with the setColumnStyle() method

    • CLICK_TARGET_CELL

      public static BBjNumber CLICK_TARGET_CELL

      A constant to define where the user clicked on the grid.

      Since:
      BBj 18.00
    • CLICK_TARGET_COLUMN_HEADER

      public static BBjNumber CLICK_TARGET_COLUMN_HEADER

      A constant to define where the user clicked on the grid.

      Since:
      BBj 18.00
    • CLICK_TARGET_CORNER

      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.

      Since:
      BBj 18.00
    • CLICK_TARGET_ROW_HEADER

      public static BBjNumber CLICK_TARGET_ROW_HEADER

      A constant to define where the user clicked on the grid.

      Since:
      BBj 18.00
    • CLICK_TARGET_SCROLLBAR

      public static BBjNumber CLICK_TARGET_SCROLLBAR

      A constant to define where the user clicked on the grid. This is currently only valid in BUI.

      Since:
      BBj 18.00
    • ClickTarget

      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.

      Since:
      BBj 18.00
    • COLUMN_WIDTHS_FROM_DATA

      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.

      Since:
      BBj 16.20
    • COLUMN_WIDTHS_FROM_HEADER

      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.

      Since:
      BBj 16.20
    • COLUMN_WIDTHS_FROM_HEADER_AND_DATA

      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.

      Since:
      BBj 16.20
    • COLUMN_WIDTHS_FROM_WIDGET

      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.

      Since:
      BBj 16.20
    • ColumnHeaderHeight

      public BBjNumber ColumnHeaderHeight

      A number that detmines the grid's column header height in pixels

    • Columns!

      public BBjVector Columns!

      A vector of columns indicating which fields in the BBjRecordSet will be used to provide data for the widget

    • ConnectString$

      public BBjString ConnectString$

      A JDBC connect string used to connect to the database

    • Font!

      public BBjFont Font!

      A BBjFont that is applied to the underlying BBjGrid control, allowing customization of the font family, size, and style

    • HeaderFont!

      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

    • HORIZONTAL_ALIGNMENT_CENTER

      public static BBjNumber HORIZONTAL_ALIGNMENT_CENTER

      A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable

    • HORIZONTAL_ALIGNMENT_LEFT

      public static BBjNumber HORIZONTAL_ALIGNMENT_LEFT

      A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable

    • HORIZONTAL_ALIGNMENT_RIGHT

      public static BBjNumber HORIZONTAL_ALIGNMENT_RIGHT

      A constant to define grid cell horizontal alignment, used in conjunction with the HorizontalAlignment field variable

    • HorizontalAlignment

      public BBjNumber HorizontalAlignment

      A number that determines the default horizontal alignment for cells in the grid. The default value is BBjGrid.GRID_ALIGN_CENTER

    • HorizontalHeaderAlignment

      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.

      Since:
      BBj 16.20
    • HorizontalScrollable

      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.

      Since:
      BBj 16.20
    • ON_GRID_REFRESH

      public static BBjNumber ON_GRID_REFRESH

      Constant for widget refresh event.

      Since:
      BBj 18.00
    • RecordSet!

      public BBjRecordSet RecordSet!

      A BBjRecordSet used to provide data for the widget

    • RowHeight

      public BBjNumber RowHeight

      A number that detmines the grid's row height in pixels

    • SCROLL_BAR_SIZE

      public static BBjNumber SCROLL_BAR_SIZE

      A constant to define the scroll bar width

    • ShouldHighlightSelectedRow

      public BBjNumber ShouldHighlightSelectedRow

      A number that acts as a boolean, determining whether the grid should highlight the selected row

    • SnapToRowHeight

      public BBjNumber SnapToRowHeight

      A number that acts as a boolean, determining whether the grid should snap to the row height

    • SortByMultipleColumns

      public BBjNumber SortByMultipleColumns

      A number that acts as a boolean, determining whether the grid should sort by multiple columns

    • SQL$

      public BBjString SQL$

      A SQL query used to provide data for the widget

    • VERTICAL_ALIGNMENT_BOTTOMT

      public static BBjNumber VERTICAL_ALIGNMENT_BOTTOMT

      A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable

    • VERTICAL_ALIGNMENT_CENTER

      public static BBjNumber VERTICAL_ALIGNMENT_CENTER

      A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable

    • VERTICAL_ALIGNMENT_TOP

      public static BBjNumber VERTICAL_ALIGNMENT_TOP

      A constant to define grid cell vertical alignment, used in conjunction with the VerticalAlignment field variable

    • VerticalAlignment

      public BBjNumber VerticalAlignment

      A number that determines the default vertical alignment for cells in the grid. The default value is BBjGrid.CENTER_ALIGNMENT

    • VerticalScrollable

      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.

      Since:
      BBj 16.20
    • WidgetRefreshCallbackObject!

      public CustomObject WidgetRefreshCallbackObject!

      Refresh event callback object.

      Since:
      BBj 18.00
    • WidgetRefreshCallbackRoutine!

      public BBjString WidgetRefreshCallbackRoutine!

      Refresh event callback routine.

      Since:
      BBj 18.00
    • WidgetRefreshEventName!

      public BBjString WidgetRefreshEventName!

      Refresh event name.

      Since:
      BBj 18.00
  • Constructor Detail

    • GridWidget

      public GridWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$)

      Creates a GridWidget

      Parameters:
      p_name$ The widget's name
      p_title$ The widget's title
      p_previewText$ The widget's preview text as shown in the Customize view and the widget toolbar's tooltip
      p_previewImage$ The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.
    • GridWidget

      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

      Parameters:
      p_name$ The widget's name
      p_title$ The widget's title
      p_previewText$ The widget's preview text as shown in the Customize view and the widget toolbar's tooltip
      p_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.
    • GridWidget

      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

      Parameters:
      p_name$ The widget's name
      p_title$ The widget's title
      p_previewText$ The widget's preview text as shown in the Customize view and the widget toolbar's tooltip
      p_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 grid
      p_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.
      See Also:
      BBjRecordSet
      BBjVector
    • GridWidget

      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

      Parameters:
      p_name$ The widget's name
      p_title$ The widget's title
      p_previewText$ The widget's preview text as shown in the Customize view and the widget toolbar's tooltip
      p_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 BBjVector
      p_rowData! The widget's data, provided in a BBjVector
    • GridWidget

      public 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

      Parameters:
      p_name$ The widget's name
      p_title$ The widget's title
      p_previewText$ The widget's preview text as shown in the Customize view and the widget toolbar's tooltip
      p_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"
    • Method Detail

      • clearColumnWidthPercentages

        public void clearColumnWidthPercentages()

        Clears the grid widget's column width percentages HashMap

      • clearDataSet

        public void clearDataSet()

        Clears the widget's underlying dataset

      • clone

        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

        Returns:
        A cloned version of the original widget
      • create

        public void create(BBjChildWindow p_widgetControlWindow!)

        Creates the GridWidget

        Parameters:
        p_widgetControlWindow! The BBjChildWindow that will contain the widget
      • destroy

        public void destroy()

        Destroys the GridWidget

      • email

        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

      • exportData

        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

        Parameters:
        p_parentX X location of the parent window
        p_parentY Y location of the parent window
        p_parentWidth Width of the parent window
        p_parentHeight Height of the parent window
      • fill

        public void fill(BBjString p_connectString$, BBjString p_sql$)

        Fills the grid's underlying dataset with data from an SQL query

        Parameters:
        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.
      • fill

        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

        Parameters:
        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"
        Since:
        BBj 16.00
      • fill

        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

        Parameters:
        p_rs! BBjRecordSet that contains the data.
        p_columns! BBjVector specifying the columns to use.
      • fill

        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

        Parameters:
        p_colHeaderData! BBjVector containing the column header data.
        p_rowData! BBjVector containg the row data.
      • getCellText

        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

        Parameters:
        p_row The cell's zero-based row number
        p_col The cell's zero-based column number
      • getClickTarget

        public 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.

        Parameters:
        p_x - The X coordinate of the click event
        p_y - The Y coordinate of the click event
        Returns:
        A constant based off of the field variables, such as GridWidget!.getCLICK_TARGET_CELL()
        Since:
        18.00
      • getColumnHeaderData

        public BBjVector getColumnHeaderData()

        Returns the header data of the GridWidget in a BBjVector

        Returns:
        A BBjVector filled with the grid's header data
      • getNumColumns

        public BBjNumber getNumColumns()

        Returns the number of columns in the GridWidget

      • getNumRows

        public BBjNumber getNumRows()

        Returns the number of rows in the GridWidget

      • getRowData

        public BBjVector getRowData()

        Returns the data of the GridWidget in a BBjVector

        Returns:
        A BBjVector filled with the grid's data
      • getSelectedColumn

        public BBjNumber getSelectedColumn()

        Returns the currently selected column in the GridWidget

      • getSelectedRow

        public BBjNumber getSelectedRow()

        Returns the currently selected row in the GridWidget

      • getSelectedText

        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.

      • getVectorsFromBBjRS

        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

        Parameters:
        p_rs! The BBjRecordSet containing the data used to populate the chart
        p_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.
      • getVectorsFromSQLQuery

        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

        Parameters:
        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.
      • isDestroyed

        public BBjNumber isDestroyed()

        Returns if the GridWidget is destroyed

        Returns:
        Returns 1 if destroyed, otherwise 0 is returned
      • isEmpty

        public BBjNumber isEmpty()

        Indicates whether the widget's dataset is empty or not

        Returns:
        0=Not empty, 1=empty
        Since:
        BBj 16.00
      • isRecordSetBased

        public BBjNumber isRecordSetBased()

        Indicates whether the widget's dataset was built from a BBjRecordSet

        Returns:
        0=Not based on a BBjRecordSet, 1=Based on a BBjRecordSet
      • isSQLBased

        public BBjNumber isSQLBased()

        Indicates whether the widget's dataset was built from an SQL query

        Returns:
        0=Not SQL Based, 1=SQL Based
      • OnControlPopupRequest

        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.

        Parameters:
        p_event! BBjPopupRequestEvent that contains event information
      • OnGridWidgetEvent

        public 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

        Since:
        BBj 18.00
      • refresh

        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.

      • resize

        public void resize(BBjNumber p_width, BBjNumber p_height)

        Resizes the widget using the provided with and height

        Parameters:
        p_width Width of the widget
        p_height Height of the widget
      • save

        public void save()

        Saves an image representation of the grid on the client's machine

      • setAutoResizeColumns

        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.

        Parameters:
        p_autoResizeColumns A number acting as a boolean that determines whether the grid should size its columns to fit within the widget
      • setAutoResizeGrid

        public 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.

        Parameters:
        p_autoResizeGrid A number acting as a boolean that determines whether the grid should size its columns to fit its data
        Since:
        BBj 16.20
      • setCallback

        public void setCallback(BBjNumber p_event, BBjString p_callbackRoutine$)

        Sets a callback for a GridWidget event

        Parameters:
        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
        Since:
        BBj 18.00
      • setCallback

        public void setCallback(BBjNumber p_event, CustomObject p_callbackObject!, BBjString p_callbackRoutine$)

        Sets a callback for a GridWidget event

        Parameters:
        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 triggered
        p_callbackRoutine$ Routine to call when the event is triggered
        Since:
        BBj 18.00
      • setCellImage

        public void setCellImage(BBjNumber p_row, BBjNumber p_column, BBjImage p_image!)

        Sets a cell image in a cell of the grid.

        Parameters:
        p_row 0-Based row.
        p_column 0-Based column.
        p_image! BBjImage to display in the cell.
      • setClickTarget

        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.

        Parameters:
        p_x - The X coordinate of the click event
        p_y - The Y coordinate of the click event
        Since:
        18.00
      • setClickTarget

        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.

        Parameters:
        p_control The BBjControl that originated the click event
        p_x The X coordinate of the click event
        p_y The Y coordinate of the click event
        Since:
        18.20
      • setColumnAlignment

        public void setColumnAlignment(BBjNumber p_column, BBjNumber p_alignment)

        Sets the alignment of a grid's column

        Parameters:
        p_column 0-Based column
        p_alignment Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()
      • setColumnBackColor

        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.

        Parameters:
        p_column 0-Based column.
        p_color! The BBjColor to apply to the column's background
        Since:
        BBj 18.00
      • setColumnBackColors

        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.

        Parameters:
        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.
        Since:
        BBj 18.00
      • setColumnForeColor

        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.

        Parameters:
        p_column 0-Based column.
        p_color! The BBjColor to apply to the column's foreground text
        Since:
        BBj 18.00
      • setColumnForeColors

        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.

        Parameters:
        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.
        Since:
        BBj 18.00
      • setColumnHeaderAlignment

        public void setColumnHeaderAlignment(BBjNumber p_column, BBjNumber p_alignment)

        Sets the alignment of a grid's column header

        Parameters:
        p_column 0-Based column header
        p_alignment Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()
        Since:
        BBj 16.20
      • setColumnHeaderAlignments

        public void setColumnHeaderAlignments(BBjNumber p_alignment)

        Sets the alignment for all column headers in the grid

        Parameters:
        p_alignment Alignment constant based off of the field variable, such as GridWidget!.getHORIZONTAL_ALIGNMENT_LEFT()
        Since:
        BBj 16.20
      • setColumnHeaderCellImage

        public void setColumnHeaderCellImage(BBjNumber p_column, BBjImage p_image!)

        Sets an image in a column header of the grid.

        Parameters:
        p_column 0-Based column.
        p_image! BBjImage to display in the column header.
      • setColumnHeaderData

        public void setColumnHeaderData(BBjVector p_colHeaderData!)

        Sets the grid's column header data using the passed vector

        Parameters:
        p_colHeaderData! BBjVector containing the column header data.
      • setColumnMask

        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()

        Parameters:
        p_column 0-Based column
        p_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.
      • setColumnStyle

        public void setColumnStyle(BBjNumber p_column, BBjNumber p_style)

        Sets the control style of a grid's column, similar to CommonGrid::setColumnStyle()

        Parameters:
        p_column 0-Based column
        p_style Cell style constant
      • setColumnWidth

        public void setColumnWidth(BBjNumber p_column, BBjNumber p_width)

        Sets the width of a grid's column

        Parameters:
        p_column 0-Based column
        p_width Width in pixels
      • setColumnWidthPercentages

        public void setColumnWidthPercentages(BBjString p_columnWidthPercentages!)

        Sets the widths of all grid columns by providing a string containing width percentages

        Parameters:
        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.
      • setColumnWidthPercentages

        public void setColumnWidthPercentages(BBjVector p_columnWidthPercentages!)

        Sets the widths of all grid columns by providing a vector containing width percentages

        Parameters:
        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.
      • setColumnWidths

        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:

        • COLUMN_WIDTHS_FROM_DATA: Sizes the columns to be wide enough to avoid truncating the cell data
        • COLUMN_WIDTHS_FROM_HEADER: Sizes the columns to be wide enough to avoid truncating the header data
        • COLUMN_WIDTHS_FROM_HEADER_AND_DATA: Sizes the columns to be wide enough to avoid truncating the header and cell data
        • COLUMN_WIDTHS_FROM_WIDGET: Sizes the columns to be narrow enough to fit within the widget, potentially truncating the data

        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.

        Parameters:
        p_columnWidthsConstant A constant (public field variable) in this class that determines how to calculate and size the column widths
        Since:
        BBj 16.20
      • setHorizontalScrollable

        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.

        Parameters:
        p_horizontalScrollable A number that acts as a boolean, determining whether the grid should show a horizontal scrollbar
        Since:
        BBj 16.20
      • setRowData

        public void setRowData(BBjVector p_rowData!)

        Sets the grid's row data using the passed vector

        Parameters:
        p_rowData! BBjVector containing the row data.
      • viewData

        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