Namespace: rxTable

rxTable

Members


<static> columnTypes :rxTableColumn.columnTypes

Type:

batchActions :external:rxActionMenu

The rxBatchActions page object for the table.
Type:

bulkSelect :external:rxBulkSelect

The rxBulkSelect page object for the table.
Type:

columnElements :external:ElementArrayFinder

Returns the elements for all the data columns on the table.
Type:

config :Object

The configuration object that the table was built with.
Type:
  • Object

footerRowElements

Returns the elements for all the footer rows on the table.

headerElements :external:ElementArrayFinder

Returns the elements for all the column headers on the table.
Type:

headers :Array.<Text>

A promise to the column headers present on the table.
Type:
  • Array.<Text>

rootElement :ElementFinder

The rxTableElement that the table was built with.
Type:
  • ElementFinder

rowElements :external:ElementArrayFinder

Returns the elements for all the data rows on the table.
Type:

The encore.rxSearchBox page object associated with the table.
Type:

searchElement

Methods


<static> initialize(rxTableElement, config)

The rxTable object exposes a table object with accessors for bulkSelect, the searchBox, individual rows, and individual columns. The columns may be accessed as properties using a convenient name specified in the config object passed to the rxTable.initialize function.

Rows accessed from an rxTable object will also inherit the column property names passed in the config object, but when accessing their data properties, only the appropriate cell for the column on that row will return.

Columns each have a data property that corresponds to an array of data items in that column (or in the context of a row, simply the corresponding cell's data). They may optionally have a sort property which will be used just for the sort tests. The property accessors and the types can be found in the rxTableColumn file.

The rxTable object, rxTableRow object, and the individual rxTableColumn objects can be extended by passing in an object in the appropriate format for Object.defineProperties.

IMPORTANT: When adding data accessors from columns, as much as possible we should try to return strings. In some cases --most notably the name/id, checkbox, and ip address fields-- we have to return a slightly different object. Examples are listed in the rxTableColumn file. For sorting, we should return a different sortable types.

Parameters:
Name Type Description
rxTableElement ElementFinder ElementFinder to be transformed into an rxTable page object.
config rxTable.tableConfig Configuration object describing the table.
Returns:
- Page object representing the table on the page.
Type
rxTable
Example
require rxTable = require('path/to/rxTable');
var myPage = Page.create({
    entityTable: {
        get: function () {
            var tblElement = $('my-table-selector');
            var config = {...};
            return rxTable.initialize(tblElement, config);
        }
    }
});

column(columnIndex)

Parameters:
Name Type Description
columnIndex Integer The zero-index of a column in the table.
Returns:
- The rxTableColumn page object for the column.
Type
rxTableColumn

filter(filterText)

Parameters:
Name Type Description
filterText String The text which will be applied to the searchBox element.

getPartial(elems)

Similar to rxTable#filter, except this one only includes the specified row elements. It does not alter the table filter in any way.
Parameters:
Name Type Description
elems external:ElementArrayFinder The ElementArrayFinder that will replace the rowElements
Returns:
- A duplicate rxTable object with only the specified rows.
Type
rxTable

getPartialByCriteria(criteria)

Similar to rxTable#getPartial, except this one uses a criteria object to select rows and generates a new rxTable object with only those rows.
Parameters:
Name Type Description
criteria Object A set of columnName/cellValue pairs to match for the rows.
Returns:
- A duplicate rxTable object with only the specified rows.
Type
rxTable

isPresent()

Returns:
- A promise to the presence status of the table on the page.
Type
Boolean

pagination()

The rxPaginate page object for the table
Returns:
Type
external:rxPaginate

row(rowIndex)

Parameters:
Name Type Description
rowIndex Integer The zero-index of a row in the table.
Returns:
- The rxTableRow page object for the row (see rxTableRow).
Type
rxTableRow

rowCount()

Returns:
- A promise for the count of data row elements on the table.
Type
Integer

Type Definitions


columnConfig

Properties:
Name Type Argument Default Description
name String Name used as the table property for the column.
label String Label used to refer to the column in preconstructed tests.
type rxTableColumn.columnType The column type (see rxTableColumn.types.
sortable String <optional>
false Flag for if the column should be sortable.
extend Object <optional>
Additional, user-configured properties for this column.

tableConfig

Type:
  • object
Properties:
Name Type Argument Default Description
label String Label used to refer to the table in preconstructed tests.
repeaterString String Repeater string for handling sortable columns.
floatingHeader Boolean <optional>
false Flag for if the table should have floating headers.
config.columns Array.<rxTable.columnConfig> Ordered array of column configuration objects.
extend Object <optional>
Additional, user-configured properties for this table.
extendRow Object <optional>
Additional, user-configured properties for all table rows.
extendColumn Object <optional>
Additional, user-configured properties for all table columns.