DHTMLX Window resize after render

I have a dhtmlx window that is created with a form (not a dhtmlx form). This form is then submitted using Ajax to a backend and this backend then returns html that is used to replace the content of the dhtmlx window. I have not been successful in dynamicly changing the height/width of this window when the return content requires a larger window.

Is there a way to call a function on the window to have it redraw with new height/width.

Scenario:
Open window (100x100px)
Submits form
Validation error is returned and needs to be displayed (i know that the height and width need to change so the window is 300x100px)
[the last step is what I am looking for.]

Thanks,
Nick

You may call setDimension method:

win.setDimension(width,height);

I have attempted to use this but the window does not change size at all.

Here is my attempt

//getDialogWindow gets me the window from the layout
//At this point the window is already filled with content from an AJAX request
function test() {
					var dlg = getDialogWindow('CRUDdialog');
					
					dlg.setDimension(100, 100);
//					dlg.setMinDimension(100, 100);
//					dlg.setMaxDimension(100, 100);
					//debugger;
				}

				setTimeout("test()", 1);
				//debugger;

Please have a look at the sample:

dhtmlxWindows/samples/03_settings/02_dimension.html

If the problem is not solved, please provide the demo that demosntrates it