nmodule/bajaui/rc/model/UxModel

API Status: Development

Description:
  • API Status: Development

Source:

Methods

get(path) → {module:nmodule/bajaui/rc/model/UxModel|module:nmodule/bajaui/rc/baja/binding/Binding|undefined}

Source:
Parameters:
Name Type Description
path string | Array.<string>
Returns:

the UxModel
kid by the given name. If an array of names are given, will follow the
path down through the UxModel structure.

Type
module:nmodule/bajaui/rc/model/UxModel | module:nmodule/bajaui/rc/baja/binding/Binding | undefined

getBindingList() → {module:nmodule/bajaui/rc/model/BindingList}

Source:
Returns:
Type
module:nmodule/bajaui/rc/model/BindingList

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:nmodule/bajaui/rc/model/UxModel>}

Source:
Returns:

UxModel
instances for this widget's children

Type
Array.<module:nmodule/bajaui/rc/model/UxModel>

getName() → {string}

Source:
Returns:
Type
string

getProperties() → {object}

Source:
Returns:

object literal describing this widget's properties

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 spandrel config object that represents this Ux element as
    rendered in the DOM. The value property will always be this, as the
    UxModel will be loaded into the spandrel widget as the value.

    Remember that the spandrel data will contain any bindings present in
    the model as well! Beware of simply passing back toSpandrel() results
    from the UxModel passed 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
spandrel data; can also be dom passed directly as a string or
function

Properties
Name Type Attributes Description
dom string | function

the DOM element into which to render
this element. Can be a function that receives an object with
properties, which are the properties of this Ux element, to be used to
generate the DOM

kids Array.<object> | function <optional>

You can specify the kids
property of the spandrel config directly. Alternately, this can be a
function that receives each UxModel in getKids(), and returns
kid.toSpandrel() or a spandrel object of your choosing.

Returns:

an object fit to be passed as a spandrel argument

Type
object

(static) make(objopt) → {Promise.<module:nmodule/bajaui/rc/model/UxModel>}

Source:
Parameters:
Name Type Attributes Description
obj object <optional>
Properties
Name Type Attributes Description
name string <optional>

the name of the widget represented by this
UxModel. This will be automatically set on child nodes; a parent-less
root widget may have no name or a name arbitrarily chosen.

type function <optional>

the Type of the widget to create

properties object <optional>

an object literal of the widget's
properties

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:nmodule/bajaui/rc/model/UxModel)> <optional>

objects
describing the widget's children

bindings Array.<module:nmodule/bajaui/rc/binding/IValueProvider> <optional>

bindings
to propagate data updates to the widget (these will be assigned to a
BindingList)

value * <optional>

can be specified if loading a value

Returns:
Type
Promise.<module:nmodule/bajaui/rc/model/UxModel>