(abstract) new (require("nmodule/webEditors/rc/wb/mgr/Manager"))(params)
- Description:
API Status: Development
View for managing groups of components, monitoring their current state
and adding/removing components to the group. The concrete manager type
must provide themoduleNameandkeyNameparameters if it requires
state to be saved between hyperlinks and page reloads, as these values
will be used when generating the key used to index the cached state data.Due to the incubating status of the manager framework, it is not
recommended that you extendManagerdirectly. Instead, extend
DeviceMgrorPointMgr: these will provide more robust functionality
for most use cases.When implementing a
Managerconstructor, please take note of themakeCommands()function.
Any commands created bymakeCommands()will be added theManager'sCommandGroupafter
the constructor runs, so commands added directly in the constructor will appear first in the
list, not last. If the ordering ofCommands matters, add them by overridingmakeCommands().
- Source:
- See:
-
- module:nmodule/driver/rc/wb/mgr/DeviceMgr
- module:nmodule/driver/rc/wb/mgr/PointMgr
Extends:
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
Extends
Methods
buildMainTableCell(column, row, dom) → {Promise|*}
- Description:
Override point, allowing a
Managerto customize the building of
a cell within its main table. This will default to delegating the
cell building to the column.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
column |
module:nmodule/webEditors/rc/wb/table/model/Column | |
row |
module:nmodule/webEditors/rc/wb/table/model/Row | |
dom |
jQuery |
Returns:
- Type
- Promise | *
destroy() → {Promise}
- Description:
Overrides the base
destroymethod to give the manager a chance to save its state
before the content (such as the child table widgets) is destroyed.
- Source:
- Overrides:
Returns:
- Type
- Promise
destroyMainTableCell(column, row, dom) → {Promise|*}
- Description:
Override point, allowing a
Managerto customize the destruction
of a cell that it created in#buildMainTableCell. The default
behavior is to delegate to the column.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
column |
module:nmodule/webEditors/rc/wb/table/model/Column | |
row |
module:nmodule/webEditors/rc/wb/table/model/Row | |
dom |
jQuery |
Returns:
- Type
- Promise | *
doDestroy() → {Promise}
- Description:
Destroy child editors, the main table, and its model.
- Source:
Returns:
- Type
- Promise
doInitialize(dom, paramsopt) → {Promise}
- Description:
Set up elements for the main table and command group.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
dom |
JQuery | ||
params |
Object |
<optional> |
the initialization parameters |
Returns:
- Type
- Promise
doLoad() → {Promise}
- Description:
Initializes and loads the main table with the
MgrModel. If overriding,
be sure to call the super method.
- Source:
Returns:
- Type
- Promise
finishMainTableRow(row, dom) → {Promise}
- Description:
Override point, allowing a
Managerto customize the dom for
aRowafter the cells have been built, but before it is inserted
into the main table. This allows sub-classes to perform any CSS
customizations they may require at an individual row level.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
row |
module:nmodule/webEditors/rc/wb/table/model/Row | |
dom |
jQuery |
Returns:
- Type
- Promise
getChildEditors(paramsopt)
- Description:
Same as
getChildWidgets, but is limited to instances ofBaseEditor.
- Source:
- Inherited From:
- Deprecated:
- use `getChildWidgets` instead.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
Object |
<optional> |
getContextMenuSelector() → {string}
- Source:
- Since:
- Niagara 4.14
Returns:
tr - by default, the elements that are right-clickable in managers are the
rows in the main and database tables.
- Type
- string
getMainTable() → {module:nmodule/webEditors/rc/wb/table/Table}
- Description:
Get the main Table widget.
- Source:
- Since:
- Niagara 4.6
Returns:
getMainTableCommands() → {Promise.<Array.<(module:bajaux/commands/Command|bajaux/commands/CommandGroup)>>}
- Description:
When the main database table is right-clicked, the default profile context menu (Views,
Actions, etc.) will be shown, with additional Manager-specific Commands appended to it. This
function defines exactly what Commands will be appended.By default, these will be any commands with the
MAIN_CONTEXT_MENUflag (i.e. the New and
Edit commands), but not including any commands with flags that have not been configured
(i.e. those commands with flags still set to the default value ofALL). You must explicitly
set the command flags to a value that includesMAIN_CONTEXT_MENUto make it appear here.
- Source:
- Since:
- Niagara 4.14
- See:
-
- module:nmodule/webEditors/rc/wb/mgr/commands/MgrCommand~flags
Returns:
- Type
- Promise.<Array.<(module:bajaux/commands/Command|bajaux/commands/CommandGroup)>>
getModel() → {module:nmodule/webEditors/rc/wb/mgr/model/MgrModel}
- Description:
Get the
MgrModelbacking this manager. This will returnundefineduntil
load()is called. It can safely be called from insidedoLoad().
- Source:
- Since:
- Niagara 4.6
Returns:
getOrdBase() → {Promise.<(baja.Component|undefined)>}
- Description:
If the loaded
MgrModelis backed by a mounted Component, then use that
Component to resolve ORDs.
- Source:
- Overrides:
- module:nmodule/webEditors/rc/fe/baja/BaseEditor#getOrdBase
Returns:
- Type
- Promise.<(baja.Component|undefined)>
getSubject(dom) → {Array|null}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
dom |
JQuery |
Returns:
the selected subject of the table being clicked
- Type
- Array | null
initialize(dom) → {Promise}
- Description:
Every
BaseWidgetwill add theeditorclass to the element and emit an
initializedtinyevent when initialized.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
dom |
JQuery |
Returns:
call to module:bajaux/Widget#initialize
- Type
- Promise
isAllDescendantsSelected() → {Boolean}
- Source:
- Since:
- Niagara 4.14
Returns:
- Type
- Boolean
load(value, paramsopt) → {Promise}
- Description:
Every
BaseEditorwill apply a number of CSS classes to a DOM element
when a value is loaded into it:editor- If the loaded value is a Baja value, a number of CSS classes
corresponding to the value's Type and all superTypes. Classes will be
determined using typeToClass().
It will also emit a
loadedtinyevent.
- Source:
- Overrides:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
baja.Value | * | ||
params |
Object |
<optional> |
Returns:
call to module:bajaux/Widget#load
- Type
- Promise
makeCommands() → {Promise.<Array.<module:bajaux/commands/Command>>|Array.<module:bajaux/commands/Command>}
- Description:
Construct an array of the commands used directly by this manager. These commands will be added
to the Manager's own command group. The Manager will make them available based on the flags
with which they are configured.MgrCommand.flags.MENU_BAR: this command will appear in Workbench's menu bar when this
manager is viewed in Workbench (this is default behavior for allbajauxviews).MgrCommand.flags.ACTION_BAR: this command will appear in the Manager's action bar (the row
of command buttons at the bottom of the Manager).MgrCommand.flags.TOOL_BAR: this command will appear in the toolbar (the command buttons in
the profile itself at the top of the view, next to the view selector).MgrCommand.flags.MAIN_CONTEXT_MENU: this command will appear when right-clicking objects in
main database table.MgrCommand.flags.LEARN_CONTEXT_MENU: this command will appear when right-clicking objects
in the discovery table.
- Source:
- Since:
- Niagara 4.14
- See:
Example
makeCommands() {
return Promise.resolve(super.makeCommands())
.then((commands) => [
...commands,
// this Command will be accessible only in the action bar and toolbar.
new Command({
flags: MgrCommand.flags.ACTION_BAR | MgrCommand.flags.TOOL_BAR
})
]);
};
Returns:
- Type
- Promise.<Array.<module:bajaux/commands/Command>> | Array.<module:bajaux/commands/Command>
(abstract) makeModel(value) → {Promise.<module:nmodule/webEditors/rc/wb/mgr/model/MgrModel>}
- Description:
Abstract method to create the
MgrModelfor the main database table. The method
should return aPromisethat will resolve to aMgrModelinstance for the
ComponentSourceprovided in the parameter. This is used to convert the value
being loaded into the widget (e.g. a network) into the model used for the table
widget.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
value |
baja.Component | the value being loaded into the |
Returns:
the model for the main table.
- Type
- Promise.<module:nmodule/webEditors/rc/wb/mgr/model/MgrModel>
makeStateHandler() → {Promise.<module:nmodule/webEditors/rc/wb/mgr/MgrStateHandler>}
- Description:
Make a state handler instance for saving and restoring the Manager's
state.
- Source:
Returns:
- Type
- Promise.<module:nmodule/webEditors/rc/wb/mgr/MgrStateHandler>
onMainTableDblClicked(event, subjects) → {Promise|*}
- Description:
The call back procedure that is overridden to control what happens when rows are double-clicked.
Typically used to invoke a command on the selected rows.
- Source:
- Since:
- Niagara 4.14
Parameters:
| Name | Type | Description |
|---|---|---|
event |
JQuery.Event | the double click event |
subjects |
Array.<*> | the selected subject of the table being clicked |
Returns:
- Type
- Promise | *
onTableSelectionChanged(selectedSubjects) → {Promise|*}
- Description:
The call back procedure that can be overridden to control what happens when a selection is made
in one of the tables in a manager.
- Source:
- Since:
- Niagara 4.14
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
selectedSubjects |
Object | an object that holds the array of the selected subjects from the tables Properties
|
Returns:
- Type
- Promise | *
restoreState() → {Promise}
- Description:
Invoke the handler created by
makeStateHandler()to restore the Manager's
current state when the Manager is loaded.
- Source:
Returns:
- Type
- Promise
saveState()
- Description:
Invoke the handler created by
makeStateHandler()to save the Manager's
current state when the Manager is destroyed.
- Source:
setAllDescendantsSelected(allDescendantsSelected)
- Source:
- Since:
- Niagara 4.14
Parameters:
| Name | Type | Description |
|---|---|---|
allDescendantsSelected |
Boolean |
setFacets(facets)
- Description:
Convert the given Facets into hidden, transient
bajaux Propertiesand
apply them to this editor. In most cases you'll want to use
properties().setValue()directly, but this method is useful when
applyingComplexslot facets.
- Source:
- Inherited From:
Parameters:
| Name | Type | Description |
|---|---|---|
facets |
baja.Facets | Object | (a |
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 |
|---|---|---|---|
flag |
Number |
<optional> |
Returns:
- Type
- Boolean