new ChildWidget(widget, name, config)

Name Type Description
widget TK.Widget

The TK.Widget to add the TK.ChildWidget to.

name string

The identifier of the element, TK.Widget[].

config object

The configuration of the child element.

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. boolean <optional>

Show/hide a non-fixed child widget on initialization.

config.option string <optional>

A custom option of the parent widget to determine the visibility of the child element. If this is null, TK.Widget.options["show_"+] is used to toggle its visibility. The child element is visible, if this options is !== false.

config.append function <optional>

A function overriding the generic append mechanism. If not null, this function is supposed to take care of adding the child widget to the parent widgets DOM. Otherwise the element of the child widget is added to the element of the parent widget.

config.inherit_options boolean <optional>

Defines if both widgets share the same set of options. If true, Setting an option on the parent widget also sets the same option on the child widget. If false, the options of the child widget can be accessed via options[ + "." + option] in the parent widget.

config.map_options array <optional>

An array containing option names to be mapped between parent and child widget. 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.inherit-options.

config.userset_ignore boolean <optional>

Do not care about the userset event of the parent widget, only keep track of set.

config.userset_delegate boolean <optional>

Delegates all user interaction from the child to the parent element. If the user triggers an event on the child widget, the userset function of the parent element is called.

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>

Defines if the parent widget receives the class toolkit-has-[name] as soon as the child element is shown.