Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IOrangeElementExtension

Represents a HTMLElement that has (or will have) a Control attached to it.

These objects are normally created by Orange.Controls.ControlManager while creating and initializing a Control. But if you know, before the fact, that an element will become a Control and need to know when it is finalized, the Orange.Controls.GetOrInitializeOrangeElement method can be used to let you know when everything is ready.

For example:

// Where el is an HTMLElement that is or will be a Orange.Controls.Control of some type 
let orangeEl = Orange.Controls.GetOrInitializeOrangeElement(el);

let onInitialized = () => { 
    let myControl = el.control as SomeTypeThatInheritsFromControl;
    myControl.myMethod();
    myControll.foo = true;
}
if (orangeEl.isInitialized)
     onInitialized();
else 
    orangeEl.addOnInitializedListener(onInitialized);

Hierarchy

  • IOrangeElementExtension

Implemented by

Index

Properties

control

control: Control

element

element: HTMLElement

isInitialized

isInitialized: boolean

Methods

addOnInitializedListener

  • addOnInitializedListener(callback: function): void

getOnOnitializedListners

  • getOnOnitializedListners(): Array<function>

removeOnInitializedListener

  • removeOnInitializedListener(callback: function): void

Generated using TypeDoc