dhtlmx window minimise move to bottom resize

Hello, i absolutely love the dhtmlx window.

I have been trying for about a week now to do something that i though was rather simple but i am having a difficult time implementing it. What i would like is when a new window is created from clicking a link, when a user clicks on the minimize button, it makes the top bar and window as small as possible and bring it to the bottom of the page. kind of like in windows or linux when you minimize something, it brings it to the task bar. how can i do this please…here is the code for my new window creation

    var dhxWins = new dhtmlXWindows();


    dhxWins.vp.style.border = “#909090 1px solid”;


    function createWindow(){

    var w1 = dhxWins.createWindow(“w1”, 10, 10, 320, 240);

    w1.setText(“dhtmlxWindow #1”);




Thank You


there is not built-in method to do that. But the component provides the setPosition method that can be used in this case dhtmlx.com/dhxdocs/doku.php?id=d … l_denymove

Great thanks for that…now what about making it smaller automatically
for example, if my header toolbar is _____________________________________________________________ this big when in normal size
when i press minimize i would like for it to automatically become __________________ this small…as an example
any idea how to do this?
Thank for your quick reply by the way :slight_smile:

You can try to use setDimension method to decrease window size:

dhxWins.window(id).setDimension(width, height);


I have the exactly same requirement in my application.

I tried with the suggested approach of using setPosition() & setDimension().

Now, when i set the dimension & position, and user clicks on the ‘park down’ button, then the window get restored to the dimension & position which was specified in the above calls, changing the original position as well as the size of the window.

For this, i tried to cache the size & position of the window which could be used when the window is popup again.

Now, i face the following problems:

  1. the API for getDimension() is returning the incorrect size. Its always returning the height as 30 irrespective of whatever i had specified while creation of the window.
  2. If i have multiple windows, all my parked up windows go to same position (0,0) hiding the previous windows.
    To overcome this, i dynamically created the position value by couting the number of windows. BUT, again stuck at the following scenario:
    We have multiple windows (for example: 5). user minimizes 3 windows. We can park them appropriately. Now user opens the second window & closes it, making the second position as vacant (and not shifting the other parked windows to take up the space). If user parks the next window, the window goes back to 3rd position (as we have only 2 windows parked up) and hence hiding the 3rd window already parked there as it was not shifted to occupy the vacant space.

Could you please suggest some solution for this scenario?

Vibhav Agrawal


the API for getDimension() is returning the incorrect size. Its always returning the height as 30 irrespective of whatever i had specified while creation of the window.

getDimension always returns current window sizes and this is correct behavior. Height can be 30 if you’ve minimized a window.

Regarding control of parked windows - we don’t have such a sample as you’ve described.

Hi Alexandra,

Please find attached sample for the issue.
Whenever user parks up the window, the size when captured in the onWindowParkDown method returns the height as ‘30’ always, irrespective of the original size of the window.

As per my analysis, the onParkUp & onParkDown are post event handlers. Due to which, the window is already parked up when the user defined event handler method is invoked. Due to which, the size returned by the API is 30 (which is its height in collapsed state). (See the below image).

So, could you please let me know some work around by which i can get the original size of the window when user clicks on parkup, so that whenever user clicks on ParkDown, i can restore the original size of the window.

Vibhav Agrawal
WindowGetDimension.zip (98 KB)

when window is created, you pass some width and height into createWindow method. So, there is no need to use windows API to get original size:

var init_height = 200;

Hi Alexandra,

When we open the window, user can resize of window & the new size will not be the same as by which we had opened it.

So, we need to get the new size (the size before the user clicked on parkup button) to which we need to restore the window back once user clicks on parkdown button.

So, is there any API/way to get the size of the window before the window was parkedUp.
I think, this variable will be available in Dhtmlx layer as the same variable wud be used when the user clicks on parkDown button.

So, could you please let me know the way to get that size?

Vibhav Agrawal


the second call of park() method will restore the state of the window before parking:


If this solution for some reason doesn’t suit, you can try use lastParkH private property:

var height = win.lastParkH;