new ChildWidget(widget, name, config)
Defines a TK.Widget as a child for another widget. This function
is used internally to simplify widget definitions. E.g. the TK.Icon of a
TK.Button is defined as a TK.ChildWidget. TK.ChildWidgets
are created/added after the initialization of the parent widget.
If not configured explicitly, all options of the child widget can
be accessed via TK.Widget.options[config.name + "." + option]
on the parent widget.
Parameters:
Name | Type | Description |
---|---|---|
widget |
TK.Widget | The TK.Widget to add the TK.ChildWidget to. |
name |
string | The identifier of the element inside the parent Element, |
config |
object | The configuration of the child element. |
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
config.create |
TK.Widget | A TK.Widget class derivate to be used as child widget. |
||
config.fixed |
boolean |
<optional> |
A fixed child widget cannot be removed after initialization. |
|
config.show |
boolean |
<optional> |
false | Show/hide a non-fixed child widget on initialization. |
config.option |
string |
<optional> |
"show_"+config.name | A custom option of the parent widget
to determine the visibility of the child element. If this is
|
config.append |
function |
<optional> |
A function overriding the generic
append mechanism. If not |
|
config.inherit_options |
boolean |
<optional> |
false | Defines if both widgets share the
same set of options. If |
config.map_options |
array |
<optional> |
[<Object>] | A list of options to be mapped between
parent and child. Keys are the options to be added to the parent, values the options
names in the child widget.
names in the parent to which the childrens options (defined as values) are mapped to.
If one of these options is set
on the parent widget, it also gets set on the child widget. This is
a fine-grained version of |
config.userset_ignore |
boolean |
<optional> |
false | Do not care about the |
config.userset_delegate |
boolean |
<optional> |
false | Delegates all user interaction from
the child to the parent element. If the user triggers an event on
the child widget, the |
config.static_events |
array |
<optional> |
[] | An array of static events to be added to the parent widget. Each entry is a mapping between the name of the event and the callback function. |
config.toggle_class |
boolean |
<optional> |
false | Defines if the parent widget
receives the class |
config.blacklist_options |
array.<string> |
<optional> |
Array containing options names
which are skipped on |
Source: |