You can easily attach some HTML content to a window via the attachHTML method. It takes as a parameter a string with HTML.
var dhxWindow = new dhx.Window({title: "Window"});
var html = "<h1>Header</h1><p>paragraph</p>";
dhxWindow.attachHTML(html);
dhxWindow.show();
Related sample: Window. Attach HTML To Window
dhtmlxWindow allows attaching other DHTMLX components inside it.
dhxWindow.attach("richtext",{mode: "document"});
dhxWindow.show();
Related sample: Window. Attaching Other Components
In case you've changed some configuration settings of a window, you can repaint it on a page via the paint method:
dhxWindow.paint();
dhtmlxWindow can be displayed in the full screen mode. To activate the full screen mode, make use of the setFullScreen method:
dhxWindow.setFullScreen();
Related sample: Window. Fullscreen Mode
You can hide a particular window or show it in a particular position on a page with the help of the hide and show methods. The show method takes two optional parameters:
If called without parameters, the method shows a window in the default position on a page.
// shows a window in the specified position
dhxWindow.show(34,54);
// hides a window
dhxWindow.hide();
Related sample: Window. Showing/Hiding Window
You can change the size of a window via the setSize method. It takes two parameters:
dhxWindow.setSize(250,250);
To get the current size of a window, use the getSize method. It will return an object with width and height of a window:
var size = dhxWindow.getSize(); // -> {width: 960, height: 469}
Related sample: Window. Set/Get Window Size
To set the position of a window on the fly, make use of the setPosition method. You should pass two parameters to the method:
dhxWindow.setPosition(20,20);
dhxWindow.show();
To get the current position of a window, use the getPosition method. It will return an object with left and top coordinates of a window:
var position = dhxWindow.getPosition(); // -> {left: 480, top: 234}
Related sample: Window. Get/Set Window Position
You can check whether a window is hidden or shown on a page using the isVisible method of the Window API. The method returns true, if a window is visible, and false if it's hidden.
var visible = window.isVisible(); // -> true/false
Related sample: Window. Get Window Visible Status
Back to top