new (require("nmodule/webEditors/rc/wb/table/model/ComponentSource"))(obj)
- Description:
API Status: Development
For use with a
ComponentTableModel, acts as a source of components to
load into table rows.This should be overridden to provide components from different kinds of
sources; e.g. search results. Each subclass must obey the following
contract:getComponents()returns an array of all available componentsaddedandremovedevents are emitted when the list of components
changes (to notify theComponentTableModelto add or remove rows).
These should be fired with arrays of all components that were just
added or removed.changedevents are emitted when one of the components in the list
has been changed (to notify theComponentTableModelthat row contents
have changed). These should be fired once per component that changed,
with two arguments: the component that changed, and the property on that
component that changed.
- Source:
- Mixes In:
- tinyevents
- See:
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
obj |
Object | baja.Component | params object, or the container itself Properties
|
Methods
(abstract) addComponents(comps, namesopt) → {Promise.<Array.<baja.Component>>}
- Description:
Add new components to this component source. Must be implemented by
subclasses and emitaddedevent as appropriate.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
comps |
Array.<baja.Component> | ||
names |
Array.<String> |
<optional> |
desired names for the components; may not |
Throws:
-
if not implemented
- Type
- Error
Returns:
as of Niagara 4.13, will be
resolved with the actual component instances after they are added
- Type
- Promise.<Array.<baja.Component>>
destroy()
- Description:
Clean up event handlers associated with this component source.
- Source:
(abstract) getComponents() → {Array.<baja.Component>}
- Description:
Gets an array of all matching child Components of the container. Must
be implemented by subclasses.
- Source:
Throws:
-
if not implemented
- Type
- Error
Returns:
- Type
- Array.<baja.Component>
getContainer() → {Object}
- Description:
The container object passed to the constructor.
- Source:
Returns:
- Type
- Object
(abstract) removeComponents(comps) → {Promise}
- Description:
Remove these components from this component source. Must be implemented
by subclasses and emitremovedevent as appropriate.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
comps |
Array.<baja.Component> |
Throws:
-
if not implemented
- Type
- Error
Returns:
- Type
- Promise