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);
Represents a
HTMLElementthat has (or will have) aControlattached to it.These objects are normally created by
Orange.Controls.ControlManagerwhile creating and initializing aControl. But if you know, before the fact, that an element will become aControland need to know when it is finalized, theOrange.Controls.GetOrInitializeOrangeElementmethod 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);