Search
WindowHost Constructor
See Also
 






Initializes a new instance of the WindowHost class.

Namespace: MindFusion.Common.UI
File: WindowHost.js

 Syntax

JavaScript  Copy Code

function WindowHost ([element])

 Parameters

element
Optional.

HTMLElement. The control's associated Dom element.

 Remarks

Each Control object needs to be associated with an HTMLElement. You can specify one in the constructor. When you use the constructor without parameters the library creates a <DIV> element automatically for the new Control. You have to add it by adding the new Control to the tree of DOM elements of your web page, between the calls of its draw and attach methods.

 Example

The following code creates a new WindowHost and adds it to the tree with DOM elements of the web page:

JavaScript  Copy Code

// Create a new WindowHost control.
var host = new ui.WindowHost();
host.width = new ui.Unit(100, ui.UnitType.Percent);
host.height = new ui.Unit(100, ui.UnitType.Percent);
host.theme = "gray";

document.body.appendChild(host.draw());
host.attach();

 See Also