new (require("nmodule/webEditors/rc/wb/table/Table"))(params)
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 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 table
Extends:
Parameters:
| Name | Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Implements:
- module:nmodule/export/rc/TransformOperationProvider
Methods
-
$handleColumnEvent(tableModel, columns, eventName)
-
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
-
$handleRowEvent(tableModel, rows, eventName, args)
-
Parameters:
Name Type Description tableModelmodule:nmodule/webEditors/rc/wb/table/model/TableModel rowsArray.<module:nmodule/webEditors/rc/wb/table/model/Row> eventNamestring argsArray.<*> Returns:
- Type
- Promise
-
$initializePagination(model)
-
Arm event handlers on the loaded PaginationModel.
Parameters:
Name Type Description modelmodule:nmodule/webEditors/rc/wb/table/pagination/PaginationModel Returns:
- Type
- Promise
-
destroy()
-
Removes the
editorclass and emits adestroyedtinyevent.- Inherited From:
Returns:
call to module:bajaux/Widget#destroy
- Type
- Promise
-
doChanged()
-
Detect density property change and apply it to the table
- See:
-
- module:nmodule/webEditors/rc/wb/table/Table for valid densities
-
doDestroy()
-
Remove
TableWidgetclass and event handlers from the loaded table model. -
doInitialize(dom, params)
-
Initialize the HTML table, creating
thead,tbody, andtfootelements.Parameters:
Name Type Description domJQuery paramsObject optional initialization parameters
-
doLoad(model)
-
Load in a
TableModel, immediately rendering all columns and rows. Event
handlers will be registered to listen for updates to the table model.Parameters:
Name Type Description modelmodule:nmodule/webEditors/rc/wb/table/model/TableModel Throws:
-
if no TableModel provided
- Type
- Error
Returns:
- Type
- Promise
-
-
getModel()
-
Get the currently loaded
TableModel.- Since:
-
- Niagara 4.6
Returns:
-
getSelectedRows()
-
Get all rows which are currently selected by the user.
- Since:
-
- Niagara 4.6
Returns:
- Type
- Array.<module:nmodule/webEditors/rc/wb/table/model/Row>
-
getSubject(elem)
-
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.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()
-
Returns:
- Type
- Promise.<Array.<module:nmodule/export/rc/TransformOperation>>
-
initialize(dom)
-
Every
BaseWidgetwill add theeditorclass to the element and emit an
initializedtinyevent when initialized.Parameters:
Name Type Description domJQuery - Inherited From:
Returns:
call to module:bajaux/Widget#initialize
- Type
- Promise
-
shouldValidate( [flag])
-
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.Parameters:
Name Type Argument Description flagNumber <optional>
- Inherited From:
Returns:
- Type
- Boolean
-
sort(column, desc)
-
Sort table rows given a column and asc/desc flag.
Override this if you want to override the sort ordering.
Parameters:
Name Type Description columnmodule:nmodule/webEditors/rc/wb/table/model/Column descboolean - Since:
-
- Niagara 4.8
Returns:
- Type
- Promise | *