API Status: Development
- Description:
API Status: Development
- Source:
Methods
clone(params) → {Promise.<module:bajaux/model/UxModel>}
- Description:
Creates a new, equivalent copy of this UxModel, including cloning all of its kids.
- Source:
- Since:
- Niagara 4.15
Parameters:
| Name | Type | Description |
|---|---|---|
params |
module:bajaux/model/UxModel~UxModelParams | if specified, these parameters |
Returns:
to be resolved to a clone of this UxModel
- Type
- Promise.<module:bajaux/model/UxModel>
get(path) → {module:bajaux/model/UxModel|module:bajaux/model/binding/IBinding|undefined}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
path |
string | Array.<string> |
Returns:
the UxModel
kid by the given name. If an array of names is given, this will follow the
path down through the UxModel structure.
- Type
- module:bajaux/model/UxModel | module:bajaux/model/binding/IBinding | undefined
getBindingList() → {module:bajaux/model/binding/BindingList}
- Source:
Returns:
getDefaultProperties() → {object}
- Source:
- Since:
- Niagara 4.15
Returns:
object literal describing this widget's default properties
- Type
- object
getFormFactor() → {string|undefined}
- Source:
- Since:
- Niagara 4.14
Returns:
the form factor this widget should be constructed with, if known
- Type
- string | undefined
getKids() → {Array.<module:bajaux/model/UxModel>}
- Source:
Returns:
UxModel
instances for this widget's children
- Type
- Array.<module:bajaux/model/UxModel>
getMetadata() → {object}
- Description:
Returns any metadata provided to the constructor.
- Source:
- Since:
- Niagara 4.15
Returns:
- Type
- object
getName() → {string}
- Source:
Returns:
- Type
- string
getProperties() → {object}
- Source:
Returns:
object literal describing this widget's properties. This includes any
default properties configured in the Widget's constructor.
- Type
- object
getType() → {function}
- Source:
Returns:
constructor for the widget to create
- Type
- function
getValue() → {*|null}
- Source:
Returns:
the value to be loaded into this widget
- Type
- * | null
isReadonly() → {boolean}
- Source:
- Since:
- Niagara 4.14
Returns:
true if this widget should be readonly
- Type
- boolean
toSpandrel(params) → {object}
- Description:
Produce a
spandrelconfig object that represents this Ux element as
rendered in the DOM. Thevalueproperty will always bethis, as the
UxModelwill be loaded into thespandrelwidget as the value.Remember that the
spandreldata will contain any bindings present in
the model as well! Beware of simply passing backtoSpandrel()results
from theUxModelpassed to your render function - you may get duplicate
bindings.toSpandrel()is typically more appropriate for calling on
kids.
- Source:
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | string | function | parameters used for generating the Properties
|
Returns:
an object fit to be passed as a spandrel argument
- Type
- object
toString() → {string}
- Source:
- Since:
- Niagara 4.15
Returns:
- Type
- string
visit(func) → {Promise.<*>}
- Description:
Visit this model and all their kid models, calling the passed in function
along the way.
- Source:
- Since:
- Niagara 4.15
Parameters:
| Name | Type | Description |
|---|---|---|
func |
function | called for every model and its kid models. The model |
Returns:
- Type
- Promise.<*>
(static) make(obj) → {Promise.<module:bajaux/model/UxModel>}
- Description:
Creates a new UxModel from a configuration object. If an existing
UxModelis given, this
creates a clone of that model.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
module:bajaux/model/UxModel~UxModelParams |
Returns:
a newly configured UxModel instance, or a
clone
- Type
- Promise.<module:bajaux/model/UxModel>
Type Definitions
UxModelParams
- Source:
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string |
<optional> |
the name of the widget represented by this |
type |
function |
<optional> |
the Type of the widget to create |
properties |
object |
<optional> |
an object literal of the widget's |
readonly |
boolean |
<optional> |
true if the widget should be readonly |
formFactor |
string |
<optional> |
the form factor this widget should be constructed with, if known |
kids |
Array.<(object|module:bajaux/model/UxModel)> |
<optional> |
objects |
bindings |
Array.<module:bajaux/model/binding/IBinding> |
<optional> |
bindings |
value |
* |
<optional> |
can be specified if loading a value |
metadata |
object |
<optional> |
(since Niagara 4.15) append any special-purpose metadata to this |
Type:
- object