__children

[ Property ]

protected __children: TcHmi.Controls.System.baseTcHmiControl[];

This property stores an array of all child controls of this control. This is the purely logical relationship and is managed by the system.

If a control is derived from the ContainerControl, this information can be viewed publicly using the getChildren function.

Definition

Type

Description

TcHmi.Controls.System.baseTcHmiControl[]

List of all child controls. If there are no children, this is an empty array.

See also

Origin: TcHmiControl

__children 1:

Available from 1.8

Sample - Javascript

console.log('We have ' + myControl.__children.length + ' child controls.');
var subControl = TcHmi.ControlFactory.create('tchmi-button', 'newbutton', myControl);
if(subControl !== undefined) {
    // The child control is not visible (not attached to the DOM), but it is our child
    console.log('Now we have one control more: ' + myControl.__children.length);
    // append control to ourself
    myControl.getElement().append(subControl.getElement());
}