Skip to main content

Configuration

This article describes the configuration options of DHTMLX Window. Set them in the configuration object that you pass to the window constructor. The options let you do the following:

  • Add a title and a footer to a window
  • Set the window size
  • Make a window closable, movable, resizable, or modal
  • Let a window cross the borders of the browser window
  • Place a window into a custom container
  • Set the HTML content of a window

Closability​

Closable Window with a header, Close button, text and an illustration in DHTMLX Suite

The closable property adds a Close button to the top right corner of a window. Users can click this button to close the window. The default value of the property is false.

const dhxWindow = new dhx.Window({
closable:false
});

Related sample: Window. Closable, movable, resizable

Custom node​

Use the node property to place a window into a custom container:

const dhxWindow = new dhx.Window({
node:"customDiv"
});

Related sample: Window. Window container

note

If you don't specify a container, the window appears in the document body.

Window with a footer holding Decline and Accept buttons below the content in DHTMLX Suite

Add a footer to a window to hold controls that work with the window content. Set the footer property to true:

const dhxWindow = new dhx.Window({
footer:true
});

Related sample: Window. Window with footer

The default footer has no controls. To add controls to the footer, use the footer object of the window. Follow the instructions in the Customization article.

Modality​

Modal Window over a grayed out blocked background page in DHTMLX Suite

Set the modal property to true to make a window modal:

const dhxWindow = new dhx.Window({
modal:true
});

Related sample: Window. Modal Window

A modal window blocks the rest of the page when it opens. Only the modal window stays active, while the page behind it turns gray and stops responding.

Movability​

Movable Window with a drag move cursor icon above its header in DHTMLX Suite

Set the movable property to true to let users move a window around the screen:

const dhxWindow = new dhx.Window({
movable:true
});

Related sample: Window. Closable, movable, resizable

Overflowing browser window​

A default window can't cross the borders of the browser window. To let a window cross them, set the viewportOverflow configuration property to true:

const dhxWindow = new dhx.Window({
viewportOverflow:true
});

Related sample: Window. Viewport overflow

note

Use the property together with the movable property.

Resizing​

Resizable Window with a diagonal resize handle in the top right corner in DHTMLX Suite

The default window has a fixed size that users can't change in the UI. Set the resizable property to true to make a window resizable:

const dhxWindow = new dhx.Window({
resizable:true
});

Related sample: Window. Closable, movable, resizable

When users hover over an edge of the window, a resizer appears. Users can drag it to change the window size.

note

To limit resizing, set the minWidth and minHeight properties.

HTML content​

Pass HTML content to the html configuration option to display it in a window:

const dhxWindow = new dhx.Window({
html:"<h1>Header</h1><p>paragraph</p>"
});

Sizing​

Use the following options to set the initial width and height of a window and its minimum size:

const dhxWindow = new dhx.Window({
width:250,
height:250,
minWidth:170,
minHeight:170
});

Related sample: Window. Closable, movable, resizable

The size options have the following default values:

Title​

A new window has an empty header. Set the title property to add a text label to the header:

const dhxWindow = new dhx.Window({
title: "DHX Window"
});

The header can also contain buttons. Use the header object of the window to manage them. For details, check the Customization article.