module:nmodule/webEditors/rc/wb/mgr/Manager

module:nmodule/webEditors/rc/wb/mgr/Manager

(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 the moduleName and keyName parameters 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 extend Manager directly. Instead, extend
    DeviceMgr or PointMgr: these will provide more robust functionality
    for most use cases.

Source:
See:
  • module:nmodule/driver/rc/wb/mgr/DeviceMgr
  • module:nmodule/driver/rc/wb/mgr/PointMgr
Extends:
Parameters:
Name Type Description
params Object
Properties
Name Type Description
moduleName String

The module name, used for accessing values from the lexicon
and also used to generate the key for saving state information for a manager type.

keyName String

The key name, used for accessing values from the lexicon and
also used to generate the key for saving state information for a manager type.

Extends

Methods

buildMainTableCell(column, row, dom) → {Promise|*}

Description:
  • Override point, allowing a Manager to 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()

Description:
  • Overrides the base destroy method to give the manager a chance to save its state
    before the content (such as the child table widgets) is destroyed.

Source:
Overrides:

destroyMainTableCell(column, row, dom) → {Promise|*}

Description:
  • Override point, allowing a Manager to 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

doLayout()

Description:
  • Update the height of the main table element so that the command buttons
    are always visible.

Source:

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 Manager to customize the dom for
    a Row after 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 of BaseEditor.

Source:
Inherited From:
Deprecated:
  • use `getChildWidgets` instead.
Parameters:
Name Type Attributes Description
params Object <optional>

getMainTable() → {module:nmodule/webEditors/rc/wb/table/Table}

Description:
  • Get the main Table widget.

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

getModel() → {module:nmodule/webEditors/rc/wb/mgr/model/MgrModel}

Description:
  • Get the MgrModel backing this manager. This will return undefined until
    load() is called. It can safely be called from inside doLoad().

Source:
Since:
  • Niagara 4.6
Returns:
Type
module:nmodule/webEditors/rc/wb/mgr/model/MgrModel

getOrdBase() → {Promise.<(baja.Component|undefined)>}

Description:
  • If the loaded MgrModel is 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 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

load(value, paramsopt) → {Promise}

Description:
  • Every BaseEditor will 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 loaded tinyevent.

Source:
Overrides:
Parameters:
Name Type Attributes Description
value baja.Value | *
params Object <optional>
Returns:

call to module:bajaux/Widget#load

Type
Promise

(abstract) makeModel(value) → {Promise.<module:nmodule/webEditors/rc/wb/mgr/model/MgrModel>}

Description:
  • Abstract method to create the MgrModel for the main database table. The method
    should return a Promise that will resolve to a MgrModel instance for the
    ComponentSource provided 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 Widget.

Returns:

the model for the main table.

Type
Promise.<module:nmodule/webEditors/rc/wb/mgr/model/MgrModel>

makeStateHandler() → {module:nmodule/webEditors/rc/wb/mgr/MgrStateHandler}

Description:
  • Make a state handler instance for saving and restoring the Manager's
    state.

Source:
Returns:
Type
module:nmodule/webEditors/rc/wb/mgr/MgrStateHandler

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:

setFacets(facets)

Description:
  • Convert the given Facets into hidden, transient bajaux Properties and
    apply them to this editor. In most cases you'll want to use
    properties().setValue() directly, but this method is useful when
    applying Complex slot facets.

Source:
Inherited From:
Parameters:
Name Type Description
facets baja.Facets | Object

(a baja.Facets instance or an object
literal to be converted to baja.Facets)

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