Search
WindowHost.attach Method
See Also
 






Container.attach override.

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

 Syntax

JavaScript  Copy Code

function attach ()

 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 calles its attach method:

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