#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# WidgetChild Class

Defined in: `widget-child/js/Widget-Child.js:9`
Module: widget-child

Widget extension providing functionality enabling a Widget to be a child of another Widget.

- Index
- Properties
- Attributes

## Item Index

### Properties

- ROOT_TYPE

### Attributes

- depth
- index
- parent
- root
- selected

## Properties

### `ROOT_TYPE`

Object

Defined in `widget-child/js/Widget-Child.js:152`

Constructor reference used to determine the root of a Widget-based object tree.

Currently used to control the behavior of the `root` attribute so that recursing up the object heirarchy can be constrained to a specific type of Widget. Widget authors should set this property to the constructor function for a given Widget implementation.

## Attributes

### `depth`

Number readonly

Defined in `widget-child/js/Widget-Child.js:82`

Number representing the depth of this Widget relative to the root Widget in the object heirarchy.

Default: -1

#### Fires event `depthChange`

Fires when the value for the configuration attribute `depth` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

#### Parameters:

- `e` EventFacade
  An Event Facade object with the following attribute-specific properties added:
  - `prevVal` Any
    The value of the attribute, prior to it being set.
  - `newVal` Any
    The value the attribute is to be set to.
  - `attrName` String
    The name of the attribute being set.
  - `subAttrName` String
    If setting a property within the attribute's value, the name of the sub-attribute property being set.

### `index`

Number readonly

Defined in `widget-child/js/Widget-Child.js:45`

Number representing the Widget's ordinal position in its parent Widget.

#### Fires event `indexChange`

Fires when the value for the configuration attribute `index` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

#### Parameters:

- `e` EventFacade
  An Event Facade object with the following attribute-specific properties added:
  - `prevVal` Any
    The value of the attribute, prior to it being set.
  - `newVal` Any
    The value the attribute is to be set to.
  - `attrName` String
    The name of the attribute being set.
  - `subAttrName` String
    If setting a property within the attribute's value, the name of the sub-attribute property being set.

### `parent`

Widget readonly

Defined in `widget-child/js/Widget-Child.js:70`

Retrieves the parent of the Widget in the object hierarchy.

#### Fires event `parentChange`

Fires when the value for the configuration attribute `parent` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

#### Parameters:

- `e` EventFacade
  An Event Facade object with the following attribute-specific properties added:
  - `prevVal` Any
    The value of the attribute, prior to it being set.
  - `newVal` Any
    The value the attribute is to be set to.
  - `attrName` String
    The name of the attribute being set.
  - `subAttrName` String
    If setting a property within the attribute's value, the name of the sub-attribute property being set.

### `root`

Widget readonly

Defined in `widget-child/js/Widget-Child.js:116`

Returns the root Widget in the object hierarchy. If the ROOT_TYPE property is set, the search for the root Widget will be constrained to parent Widgets of the specified type.

#### Fires event `rootChange`

Fires when the value for the configuration attribute `root` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

#### Parameters:

- `e` EventFacade
  An Event Facade object with the following attribute-specific properties added:
  - `prevVal` Any
    The value of the attribute, prior to it being set.
  - `newVal` Any
    The value the attribute is to be set to.
  - `attrName` String
    The name of the attribute being set.
  - `subAttrName` String
    If setting a property within the attribute's value, the name of the sub-attribute property being set.

### `selected`

Number

Defined in `widget-child/js/Widget-Child.js:26`

Number indicating if the Widget is selected. Possible values are:

0
  (Default) Not selected
1
  Fully selected
2
  Partially selected

Default: 0

#### Fires event `selectedChange`

Fires when the value for the configuration attribute `selected` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

#### Parameters:

- `e` EventFacade
  An Event Facade object with the following attribute-specific properties added:
  - `prevVal` Any
    The value of the attribute, prior to it being set.
  - `newVal` Any
    The value the attribute is to be set to.
  - `attrName` String
    The name of the attribute being set.
  - `subAttrName` String
    If setting a property within the attribute's value, the name of the sub-attribute property being set.