new ChildElement(widget, name, config)
Creates a HTMLElement as a child for a widget. Is used to simplify
widget definitions. E.g. the tiny marker used to display the back-end
value is a simple DIV added using TK.ChildElement. The generic element
is a DIV added to TK.Widget.element with the class
toolkit-[name]
. Default creating and adding can be
overwritten with custom callback functions.
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 |
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
|
config.display_check |
function |
<optional> |
A function overriding the
generic |
|
config.append |
function |
<optional> |
A function overriding the generic
append mechanism. If not |
|
config.create |
function |
<optional> |
A function overriding the generic
creation mechanism. If not |
|
config.toggle_class |
boolean |
<optional> |
false | Defines if the parent widget
receives the class |
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: |