new (require("nmodule/webEditors/rc/wb/table/Table"))(params)
- Description:
API Status: Development
Table widget.
It supports the following
bajauxProperties: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.leftJustify: (boolean) set to true to left-justify the table and span
the last visible column of the table to 100% width.This makes the table
itself 100% width now, so the table will no longer work inline. Defaults
to true.hideUnseenColumns: (boolean) set tofalseto cause columns with the
UNSEENflag to always be shown. Defaults totrue(unseen columns are
hidden by default).density: (string) supports "small", "medium" and "large" font-sizes to
specify the density of the tableenableStriping: (boolean) defaults to true and shows stripes on table widget,
and is ignored if on a- Source:
- Implements:
- module:nmodule/export/rc/TransformOperationProvider
Extends:
Parameters:
Name Type Description paramsObject Properties
Name Type Attributes Description selectionmodule: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
Members
(static) CELL_ACTIVATED_EVENT :string
- Description:
Will be triggered when a row is "activated," or selected by the user, such as by
double-clicking on it. The handler will receive the Table that triggered the
event, and the Row and Column that were activated.
- Source:
- Since:
- Niagara 4.12
Will be triggered when a row is "activated," or selected by the user, such as by
double-clicking on it. The handler will receive the Table that triggered the
event, and the Row and Column that were activated.Type:
- string
Example
dom.on(Table.CELL_ACTIVATED_EVENT, (event, table, activatedRow, activatedColumn) => { const activatedValue = activatedColumn.getValueFor(activatedRow); // value for the cell const activatedSubject = activatedRow.getSubject(); // value for the row });(static) ROW_SELECTION_CHANGED_EVENT :string
- Description:
Will be triggered when rows are selected or deselected. The handler will receive the Table
that triggered the event. Calculating which rows are selected is cheap but not free, so to
protect performance in the case that the actual selected rows are not used, they will not
be passed to the handler. To act on the newly selected rows, calltable.getSelectedRows().
- Source:
- Since:
- Niagara 4.12
Will be triggered when rows are selected or deselected. The handler will receive the Table
that triggered the event. Calculating which rows are selected is cheap but not free, so to
protect performance in the case that the actual selected rows are not used, they will not
be passed to the handler. To act on the newly selected rows, calltable.getSelectedRows().Type:
- string
Example
dom.on(Table.ROW_SELECTION_CHANGED_EVENT, (event, table) => { const newSelectedRows = table.getSelectedRows(); });Methods
$applyDensity()
- Description:
Applies density property to the table.
- Source:
$handleColumnEvent(tableModel, columns, eventName) → {Promise}
- Source:
Parameters:
Name Type Description tableModelmodule:nmodule/webEditors/rc/wb/table/model/TableModel columnsArray.<module:nmodule/webEditors/rc/wb/table/model/Column> eventNamestring Returns:
- Type
- Promise
$initializePagination(model) → {Promise}
- Description:
Arm event handlers on the loaded PaginationModel.
- Source:
Parameters:
Name Type Description modelmodule:nmodule/webEditors/rc/wb/table/pagination/PaginationModel Returns:
- Type
- Promise
$rebuildThead(tableModel) → {Promise}
- Source:
Parameters:
Name Type Description tableModelmodule:nmodule/webEditors/rc/wb/table/model/TableModel Returns:
- Type
- Promise
destroy() → {Promise}
- Description:
Removes the
editorclass and emits adestroyedtinyevent.
- 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
TableWidgetclass and event handlers from the loaded table model.
- Source:
doInitialize(dom, params)
- Description:
Initialize the HTML table, creating
thead,tbody, andtfootelements.
- Source:
Parameters:
Name Type Description domJQuery paramsObject 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 modelmodule: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:
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 correspondingRowwill be used to show the context menu.If the row being right-clicked is already selected, then the subjects of
all selectedRows will be used.
- Source:
Parameters:
Name Type Description elemJQuery 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
BaseWidgetwill add theeditorclass to the element and emit an
initializedtinyevent when initialized.
- Source:
- Inherited From:
Parameters:
Name Type Description domJQuery 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 ashouldValidatebajauxProperty
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
flagis given, then the check against theshouldValidate
Propertywill return true only if the value bitwise matches the
parameter. SeeBaseWidget.SHOULD_VALIDATE_ON_SAVE, etc.
- Source:
- Inherited From:
Parameters:
Name Type Attributes Description flagNumber <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 columnmodule:nmodule/webEditors/rc/wb/table/model/Column descboolean Returns:
- Type
- Promise | *