UIZE JavaScript Framework

MODULES Uize.Widget.mDeclarativeChildren

1. Introduction

The Uize.Widget.mDeclarativeChildren mixin implements features to provide a declarative approach to adding child widgets to a widget.

DEVELOPERS: Ben Ilegbodu, original code contributed by Zazzle Inc.

1.1. Examples

There are no dedicated showcase example pages for the Uize.Widget.mDeclarativeChildren module.

SEARCH FOR EXAMPLES

Use the link below to search for example pages on the UIZE Web site that reference the Uize.Widget.mDeclarativeChildren module...

SEARCH

1.2. Implementation Info

The Uize.Widget.mDeclarativeChildren module defines the Uize.Widget.mDeclarativeChildren object under the Uize.Widget namespace.

1.2.1. Features Introduced in This Module

The features listed in this section have been introduced in this module.

STATIC PROPERTIES

Uize.Widget.mDeclarativeChildren.moduleName | Uize.Widget.mDeclarativeChildren.pathToResources

1.2.2. Features Overridden in This Module

No features have been overridden in this module.

1.2.3. Features Inherited From Other Modules

This module has no inherited features.

1.2.4. Modules Directly Under This Namespace

There are no modules directly under this namespace.

1.2.5. Unit Tests

There is no dedicated unit tests module for the Uize.Widget.mDeclarativeChildren module.

2. Static Methods

2.1. Uize.Widget.mDeclarativeChildren.children

Lets you conveniently declare one or more child widgets, by specifying the children in an object.

SYNTAX

MyWidgetClass.children (childrenOBJ);

VERBOSE EXAMPLE

MyNamespace.MyWidgetClass = Uize.Widget.mDeclarativeChildren.subclass ({
  children:{
    menu:{
      text:'Ok',
      widgetClass:Uize.Widget,
      value:'foo',
      values:[
        {
          name:'foo',
          value:'Foo'
        },
        {
          name:'bar',
          value:'Bar'
        }
      ]
    },
    cancel:{
      text:'Cancel',
      widgetClass:Uize.Widget.Button,
      selected:true
    }
  }
});

SHORT-HAND EXAMPLE

MyNamespace.MyWidgetClass = Uize.Widget.mDeclarativeChildren.subclass ({
  children:{
    menu:Uize.Widget,
    cancel:Uize.Widget.Button
  }
});

FUNCTION EXAMPLE

MyNamespace.MyWidgetClass = Uize.Widget.mDeclarativeChildren.subclass ({
  children:{
    menu:function() {
      // "this" is the widget
      return {
        widgetClass:this._menuWidgetClass,
        value'foo'
      };
    }
  }
});

3. Static Properties

3.1. Uize.Widget.mDeclarativeChildren.moduleName

IMPLEMENTATION INFO

this feature was introduced in this module

3.2. Uize.Widget.mDeclarativeChildren.pathToResources

IMPLEMENTATION INFO

this feature was introduced in this module