protected
Widget|Array
_add
(
child
,
index
)
Adds a Widget as a child. If the specified Widget already
has a parent it will be removed from its current parent before
being added as a child.
- Parameters:
-
child
<Widget|Object>
The Widget instance, or configuration
object for the Widget to be added as a child.
-
child
<Array>
Array of Widget instances, or configuration
objects for the Widgets to be added as a children.
-
index
<Number>
(Optional.) Number representing the position at
which the child should be inserted.
- Returns:
Widget|Array
- Successfully added Widget or Array containing the
successfully added Widget instance(s). If no children where added, will
will return undefined.
protected
void
_afterActiveDescendantChange
(
event
)
Attribute change listener for the activeDescendant
attribute, responsible for setting the value of the
parent's activeDescendant
attribute.
- Parameters:
-
event
<EventFacade>
The event facade for the attribute change.
protected
void
_afterDestroyChild
(
event
)
Destroy event listener for each child Widget, responsible for removing
the destroyed child Widget from the parent's internal array of children
(_items property).
- Parameters:
-
event
<EventFacade>
The event facade for the attribute change.
protected
void
_afterParentSelectedChange
(
event
)
Attribute change listener for the selected
attribute, responsible for syncing the selected state of all children to
match that of their parent Widget.
- Parameters:
-
event
<EventFacade>
The event facade for the attribute change.
protected
void
_afterSelectionChange
(
event
)
Attribute change listener for the selection
attribute, responsible for setting the value of the
parent's selected
attribute.
- Parameters:
-
event
<EventFacade>
The event facade for the attribute change.
protected
void
_createChild
(
config
)
Creates an instance of a child Widget using the specified configuration.
By default Widget instances will be created of the type specified
by the defaultChildType
attribute. Types can be explicitly
defined via the type
property of the configuration object
literal.
- Parameters:
-
config
<Object>
Object literal representing the configuration
used to create an instance of a Widget.
protected
void
_defRemoveChildFn
(
event
,
child
,
index
)
Default removeChild handler
- Parameters:
-
event
<EventFacade>
The Event object
-
child
<Widget>
The Widget instance to be removed.
-
index
<Number>
Number representing the index of the Widget to
be removed.
protected
Widget|Array
_setSelection
(
child
)
Default setter for selection
attribute changes.
- Parameters:
-
child
<Widget|Array>
Widget or Array of Widget instances.
- Returns:
Widget|Array
- Widget or Array of Widget instances.
protected
void
_uiAddChild
(
child
,
parentNode
)
Updates the UI in response to a child being added.
- Parameters:
-
child
<Widget>
The child Widget instance to render.
-
parentNode
<Object>
The Node under which the
child Widget is to be rendered.
protected
void
_uiRemoveChild
(
child
)
Updates the UI in response to a child being removed.
- Parameters:
-
child
<Widget>
The child Widget instance to render.
protected
void
_updateActiveDescendant
(
event
)
Attribute change listener for the focused
attribute of child Widgets, responsible for setting the value of the
parent's activeDescendant
attribute.
- Parameters:
-
event
<EventFacade>
The event facade for the attribute change.
protected
void
_updateSelection
(
event
)
Attribute change listener for the selected
attribute of child Widgets, responsible for setting the value of the
parent's selection
attribute.
- Parameters:
-
event
<EventFacade>
The event facade for the attribute change.
Y.ArrayList
add
(
child
,
index
)
Adds a Widget as a child. If the specified Widget already
has a parent it will be removed from its current parent before
being added as a child.
- Parameters:
-
child
<Widget|Object>
The Widget instance, or configuration
object for the Widget to be added as a child.
-
child
<Array>
Array of Widget instances, or configuration
objects for the Widgets to be added as a children.
-
index
<Number>
(Optional.) Number representing the position at
which the child should be inserted.
- Returns:
Y.ArrayList
- Y.ArrayList containing the successfully added
Widget instance(s). If no children where added, will return an empty
Y.ArrayList instance.
Widget
remove
(
index
)
Removes the Widget from its parent. Optionally, can remove
a child by specifying its index.
- Parameters:
-
index
<Number>
(Optional.) Number representing the index of the
child to be removed.
- Returns:
Widget
- Widget instance that was successfully removed, otherwise
undefined.
Y.ArrayList
removeAll
(
)
Removes all of the children from the Widget.
- Returns:
Y.ArrayList
- Y.ArrayList instance containing Widgets that were
successfully removed. If no children where removed, will return an empty
Y.ArrayList instance.
void
selectChild
(
i
)
Selects the child at the given index (zero-based).
- Parameters:
-
i
<Number>
the index of the child to be selected