Skip navigation links
Dashboard

Class GridExWidget

Inheritance:
    • Method Detail

      • clearDataSet

        public void clearDataSet()

        Clears the widget's underlying dataset

      • clone

        public 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

        Returns:
        A cloned version of the original widget
      • create

        public void create(BBjChildWindow p_widgetControlWindow!)

        Called to create the widget

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

        public void destroy()

        Destroys the GridExWidget

      • display

        public void display(BBjNumber p_display)

        Sets the widget's visibility

        Parameters:
        p_display TRUE (1) to make the widget visible, FALSE (0) to hide it
      • 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_parentX, BBjNumber p_parentWidth, BBjNumber p_parentHeight)

        Called to display a export dialog in order to export widget data

        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(ResultSet p_resultSet!)

        Fills the grid's underlying dataset with a BASIS Components ResultSet

        Parameters:
        p_resultSet! The BASIS Components ResultSet that contains the data for the widget
        See Also:
        ResultSet
        Since:
        BBj 19.12
      • fill

        public 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. The filter can be used to specify:

        • a range of values(from-to)
        • an exact primary key value
        • the KNUM to use

        The filter should use one of the following static fields:

        • JLibResultSetImporter.FILTER_KNUM
        • JLibResultSetImporter.FILTER_RANGE_FROM
        • JLibResultSetImporter.FILTER_RANGE_TO
        • JLibResultSetImporter.FILTER_VALUE

        Example:

        
        filter! = new DataRow()
        filter!.setFieldValue("FILTER_KNUM", "1")
        filter!.setFieldValue("FILTER_RANGE_FROM", "000002")
        filter!.setFieldValue("FILTER_RANGE_TO", "000010")
        

        Parameters:
        p_file$ The the name of the MKEYED, XKEYED, or VKEYED file that contains the data for the widget
        p_template$ The string template describing the records in the file
        p_filter! The DataRow that acts as a filter when retrieving data
        See Also:
        DataRow
        Since:
        BBj 19.12
      • 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"
      • 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.
      • getColumnHeaderData

        public BBjVector getColumnHeaderData()

        Returns the header data of the GridWidget in a BBjVector

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

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

        Returns:
        The GridExWidget's underlying BBjGridExWidget after it has been created
      • getNumColumns

        public BBjNumber getNumColumns()

        Returns the number of columns in the GridExWidget

        Returns:
        The number of columns in the GridExWidget after it has been filled
      • getNumRows

        public BBjNumber getNumRows()

        Returns the number of rows in the GridExWidget

        Returns:
        The number of rows in the GridExWidget after it has been filled
      • getResultSet

        public BBjGridExWidget getResultSet()

        Returns the GridExWidget's underlying BASIS Components ResultSet

        Returns:
        The GridExWidget's underlying BASIS Components ResultSet
      • getResultSetFromBBjRS

        public ResultSet getResultSetFromBBjRS(BBjRecordSet p_rs!, BBjVector p_columns!)

        Returns a BASIS Components ResultSet filled with data given a BBjRecordSet and a vector of columns

        This is an internal method used by the widget class

        Parameters:
        p_rs! The BBjRecordSet containing the data used to populate the ResultSet
        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.
        Returns:
        A BASIS Components ResultSet that contains the data from the BBjRecordSet
      • getResultSetFromSQLQuery

        public 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

        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 ResultSet
        Returns:
        A BASIS Components ResultSet that contains the data from the query
      • getResultSetFromVectors

        public 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

        This is an internal method used by the widget class

        Parameters:
        p_colHeaderData! BBjVector which contains the column header data
        p_rowData! BBjVector which contains the row data
        Returns:
        A BASIS Components ResultSet that contains the data from the query
      • getRowData

        public BBjVector getRowData()

        Returns the data of the GridWidget in a BBjVector

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

        public BBjNumber isDestroyed()

        Returns if the GridExWidget 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
      • 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
      • isVectorBased

        public BBjNumber isVectorBased()

        Indicates whether the widget's dataset was built from BBjVectors for the column header and row data

        Returns:
        0=Not based on BBjVectors, 1=Based on BBjVectors
      • pinColumn

        public void pinColumn(BBjNumber p_column, BBjNumber p_side)

        Pins a column in the grid to the left or right margin

        Parameters:
        p_column The 0-based index of the column to be pinned
        p_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()
      • 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

      • 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 GridExWidget.getHORIZONTAL_ALIGNMENT_LEFT()
      • 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 GridExWidget.getHORIZONTAL_ALIGNMENT_LEFT()
      • 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 GridExWidget.getHORIZONTAL_ALIGNMENT_LEFT()
      • setColumnHeaderData

        public 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

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

        public void setColumnHeaderHeight(BBjNumber p_height)

        Sets the row height for the grid's header cells

        Parameters:
        p_height Height in pixels
      • setColumnWidth

        public void setColumnWidth(BBjNumber p_column, BBjNumber p_width)

        Sets the width of a grid's column given the 0-based column index

        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 - note that sizing columns in this manner works best, especially when the widget is popped out and resized.

        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 - note that sizing columns in this manner works best, especially when the widget is popped out and resized.

        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.
      • setRowHeight

        public void setRowHeight(BBjNumber p_height)

        Sets the row height for the grid's body cells

        Parameters:
        p_height Height in pixels
      • 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