TK.ChildElement

new ChildElement(widget, name, config)

Parameters:
Name Type Description
widget TK.Widget

The TK.Widget to add the TK.ChildElement to.

name string

The identifier of the element. It will be prefixed by an underscore TK.Widget["_" + config.name].

config object

The configuration of the child element.

Properties:
Name Type Attributes Default Description
config.show boolean <optional>
false

Show/hide the child element 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 null, TK.Widget.options["show_"+ config.name] is used to toggle its visibility. The child element is visible, if this options is !== false.

config.display_check function <optional>

A function overriding the generic show_option behavior. If set, this function is called with the value of show_option as argument as soon as it gets set and is supposed to return a boolean defining the visibility of the element.

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 element to the parent widgets DOM.

config.create function <optional>

A function overriding the generic creation mechanism. If not null, this function is supposed to create and return a DOM element to be added to the parent widget.

config.toggle_class boolean <optional>
false

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

config.draw_options array <optional>

A list of options of the parent widget which are supposed to trigger a check if the element has to be added or removed.

config.draw function <optional>

A function to be called on redraw.

Source: