module:nmodule/webEditors/rc/wb/table/Table

module:nmodule/webEditors/rc/wb/table/Table

new (require("nmodule/webEditors/rc/wb/table/Table"))(params)

Description:
  • API Status: Development

    Table widget.

    It supports the following bajaux Properties:

    • fixedHeaders: (boolean) set to true to allow scrolling the table body
      up and down while the headers remain fixed. This will only make sense
      when the table widget is instantiated in a block-level element, like a
      div, whose dimensions are constrained.
    • hideUnseenColumns: (boolean) set to false to cause columns with the
      UNSEEN flag to always be shown. Defaults to true (unseen columns are
      hidden by default).
    • density: (string) supports "small", "medium" and "large" font-sizes to
      specify the density of the table
Source:
Implements:
  • module:nmodule/export/rc/TransformOperationProvider
Extends:
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
selection module:nmodule/webEditors/rc/util/ListSelection <optional>

the ListSelection
to manage which rows are currently selected - if not given, a new one will be constructed.

Extends

Methods

$handleColumnEvent(tableModel, columns, eventName) → {Promise}

Source:
Parameters:
Name Type Description
tableModel module:nmodule/webEditors/rc/wb/table/model/TableModel
columns Array.<module:nmodule/webEditors/rc/wb/table/model/Column>
eventName string
Returns:
Type
Promise

$handleRowEvent(tableModel, rows, eventName, args) → {Promise}

Source:
Parameters:
Name Type Description
tableModel module:nmodule/webEditors/rc/wb/table/model/TableModel
rows Array.<module:nmodule/webEditors/rc/wb/table/model/Row>
eventName string
args Array.<*>
Returns:
Type
Promise

$initializePagination(model) → {Promise}

Description:
  • Arm event handlers on the loaded PaginationModel.

Source:
Parameters:
Name Type Description
model module:nmodule/webEditors/rc/wb/table/pagination/PaginationModel
Returns:
Type
Promise

destroy() → {Promise}

Description:
  • Removes the editor class and emits a destroyed tinyevent.

Source:
Inherited From:
Returns:

call to module:bajaux/Widget#destroy

Type
Promise

doChanged()

Description:
  • Detect density property change and apply it to the table

Source:
See:
  • module:nmodule/webEditors/rc/wb/table/Table for valid densities

doDestroy()

Description:
  • Remove TableWidget class and event handlers from the loaded table model.

Source:

doInitialize(dom, params)

Description:
  • Initialize the HTML table, creating thead, tbody, and tfoot elements.

Source:
Parameters:
Name Type Description
dom JQuery
params Object

optional initialization parameters

doLoad(model) → {Promise}

Description:
  • Load in a TableModel, immediately rendering all columns and rows. Event
    handlers will be registered to listen for updates to the table model.

Source:
Parameters:
Name Type Description
model module:nmodule/webEditors/rc/wb/table/model/TableModel
Throws:

if no TableModel provided

Type
Error
Returns:
Type
Promise

getModel() → {module:nmodule/webEditors/rc/wb/table/model/TableModel}

Description:
  • Get the currently loaded TableModel.

Source:
Since:
  • Niagara 4.6
Returns:
Type
module:nmodule/webEditors/rc/wb/table/model/TableModel

getSelectedRows() → {Array.<module:nmodule/webEditors/rc/wb/table/model/Row>}

Description:
  • Get all rows which are currently selected by the user.

Source:
Since:
  • Niagara 4.6
Returns:
Type
Array.<module:nmodule/webEditors/rc/wb/table/model/Row>

getSubject(elem) → {Array.<*>}

Description:
  • When showing a context menu, will decide which values in the TableModel are
    the targets of the right-click operation.

    If the row being right-clicked is not already selected, then the subject of
    the corresponding Row will be used to show the context menu.

    If the row being right-clicked is already selected, then the subjects of
    all selected Rows will be used.

Source:
Parameters:
Name Type Description
elem JQuery
Returns:

array containing the subjects of the rows being
right-clicked. Can return an empty array if no rows are present.

Type
Array.<*>

getTransformOperations() → {Promise.<Array.<module:nmodule/export/rc/TransformOperation>>}

Source:
Returns:
Type
Promise.<Array.<module:nmodule/export/rc/TransformOperation>>

initialize(dom) → {Promise}

Description:
  • Every BaseWidget will add the editor class to the element and emit an
    initialized tinyevent when initialized.

Source:
Inherited From:
Parameters:
Name Type Description
dom JQuery
Returns:

call to module:bajaux/Widget#initialize

Type
Promise

shouldValidate(flagopt) → {Boolean}

Description:
  • This provides an extra hook for an editor to declare itself as needing to
    be validated before saving or not. The default behavior is to return true
    if this editor is modified, or if a shouldValidate bajaux Property
    is present and truthy. If neither of these conditions is true, it will
    check all known child editors, and return true if it has a child editor
    that should validate.

    If flag is given, then the check against the shouldValidate
    Property will return true only if the value bitwise matches the
    parameter. See BaseWidget.SHOULD_VALIDATE_ON_SAVE, etc.

Source:
Inherited From:
Parameters:
Name Type Attributes Description
flag Number <optional>
Returns:
Type
Boolean

sort(column, desc) → {Promise|*}

Description:
  • Sort table rows given a column and asc/desc flag.

    Override this if you want to override the sort ordering.

Source:
Since:
  • Niagara 4.8
Parameters:
Name Type Description
column module:nmodule/webEditors/rc/wb/table/model/Column
desc boolean
Returns:
Type
Promise | *