tachControls
[ Funktion ] [Deprecated]
export function tachControls(
callback: null | (
() => void
) = null
): void;
Initiiert eine Prüfung ob ein Control zum DOM hinzugefügt oder entfernt wurde und ruft die __attach bzw die __detach Funktion des entsprechenden Controls auf.
![]() | Ab Version 1.10 gilt diese Funktion als veraltet und hat keine Funktion mehr. Das System erkennt automatisch, ob Controls zum DOM hinzugefügt oder entfernt wurden. |
Parameter
Name | Typ | Beschreibung |
---|---|---|
callback | null, () => void | Die Callback Funktion wird aufgerufen, wenn das System die Prüfung auf neue Controls im DOM abgeschlossen hat. |
Rückgabewert
Typ | Beschreibung |
---|---|
void | Kein Rückgabewert. |
![]() | Verfügbar ab Version 1.8 |
Beispiel - JavaScript
// create control
var subControl = TcHmi.ControlFactory.create('tchmi-button', 'newbutton');
if(subControl !== undefined) {
// append control to ourself
myControl.getElement().append(subControl.getElement());
// force check if controls has been added
TcHmi.Controls.tachControls();
}