Include Page |
---|
| Infusion14:sneak peek warningInfusion14: |
---|
| sneak peek warning |
---|
|
Div |
---|
class | Wiki Markup |
---|
{div:class=api-page | }
h1. fluid.initDependents(that) Section |
---|
Column |
---|
|
|
Initializes any dependent subcomponents and invokers specified in the options for a component.
Code Block |
---|
javascript | javascript | bgColor | white |
---|
borderStyle | none |
---|
{section}
{column:width=70%}
Initializes any dependent subcomponents and [invokers|Invokers] specified in the options for a component.
{code:javascript|borderStyle=none|bgColor=white}
fluid.initDependents(that);
{code}
*File name:* {{FluidIoC.js
Parameters
Span |
---|
class | }}
h2. Parameters
{span:class=borderless-table
that
| }
|*{{that}}*| (Object) the {{that}} object of the parent
component Return Value
Column |
---|
|
Notes
fluid.initDependents()
examines the components
and invokers
properties of the parent components options (i.e. that.options.components
. If neither of these propertis is found, or is empty, this function will have no effect.
fluid.initDependents()
works in conjunction with fluid.demands()
. For more information on this relationship, please see How to Use Infusion IoC.
Example
Span |
---|
|
Code Block |
---|
javascript | javascript | component |
{span}
h2. Return Value
{span:class=borderless-table}
|*None*| |
{span}
{column}
{column:width=5%}
{column}
{column}
h3. See Also
* [fluid.demands]
* [fluid.defaults]
* [Invokers]
* [How to Use Infusion IoC]
{column}
{section}
----
h3. Notes
{{fluid.initDependents()}} examines the {{components}} and {{invokers}} properties of the parent components options (i.e. {{that.options.components}}. If neither of these propertis is found, or is empty, this function will have no effect.
{{fluid.initDependents()}} works in conjunction with [{{fluid.demands()}}|fluid.demands]. For more information on this relationship, please see [How to Use Infusion IoC].
h3. Example
{span:class=borderless-table}
|{code:javascript}
myApp.myComponent = function (container, options) {
var that = fluid.initView("myApp.myComponent", container, options);
...
fluid.initDependents(that);
...
return that;
};
fluid.defaults("myApp.myComponent", {
components: {
sub1: {
type: "myApp.mySubcomponent1"
},
sub2: {
type: "myApp.mySubcomponent2"
}
}
});
{code}|In this example, the {{fluid.defaults()}} call describes two subcomponents, {{sub1}} and {{sub2}} in the {{components}} property. The call to {{fluid.initDependents()}} will initialize these two subcomponents based on any demands specified through {{[fluid.demands]}} (not shown here: please see the [How to Use Infusion IoC] for information about how these functions work together, and the [{{fluid.demands()}} API|fluid.demands] for details about that function).|
{span}
{div}