API Status: Development
Methods
-
<static> make(obj)
-
Parameters:
Name Type Description objobject Properties
Name Type Argument Description namestring <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.typefunction the Type of the widget to create
propertiesobject <optional>
an object literal of the widget's
propertieskidsArray.<(object|module:nmodule/bajaui/rc/model/UxModel)> <optional>
objects
describing the widget's childrenbindingsArray.<module:nmodule/bajaui/rc/binding/IValueProvider> <optional>
bindings
to propagate data updates to the widget (these will be assigned to a
BindingList)Returns:
- Type
- Promise.<module:nmodule/bajaui/rc/model/UxModel>
-
get(path)
-
Parameters:
Name Type Description pathstring | 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 | undefined
-
getBindingList()
-
Returns:
-
getKids()
-
Returns:
UxModel
instances for this widget's children- Type
- Array.<module:nmodule/bajaui/rc/model/UxModel>
-
getProperties()
-
Returns:
object literal describing this widget's properties
- Type
- object
-
getType()
-
Returns:
constructor for the widget to create
- Type
- function
-
getValue()
-
Returns:
the value to be loaded into this widget
- Type
- * | null
-
toSpandrel(params)
-
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.Parameters:
Name Type Description paramsobject | string | function parameters used for generating the
spandreldata; can also bedompassed directly as a string or
functionProperties
Name Type Argument Description domstring | 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 DOMkidsArray.<object> | function <optional>
You can specify the
kids
property of thespandrelconfig directly. Alternately, this can be a
function that receives eachUxModelingetKids(), and returns
kid.toSpandrel()or aspandrelobject of your choosing.Returns:
an object fit to be passed as a
spandrelargument- Type
- object