Facing issues with maximize/minimize functions in window

Hi Team.

I am creating a window inside a viewport that is attached to viewport div. The viewport div is nested inside a main div. Now when the main div acts as the default div where all other divs are placed and based on its dimensions, all other elements are resized/rearranged. However, I am facing issue resizing the window placed inside the viewport div. I have placed a sample code below. On onmaximize event, the code get the width of the main div and applies to viewport div and using setdimension, sets the width for the window. However, when the setdimension function is called from the onmaximize event, the onminimize event is called and the window doesnt resize eventually.

dhxWin = new dhtmlXWindows();
win = dhxWin.createWindow(“Window”, 10, 10, 625, 250);

win.attachEvent(“onMinimize”, function (win) {

win.attachEvent(“onMaximize”, function (win) {

It is the expected scenario. The maximize and setDimension functions are mutually exclusive. First one resizes a window to maximum size ( size of a viewport ), while the second one sets a width of a window to some fixed size.