dhtmlxWindow maximise button is not working for IE6

this peice of code in dhtmlxwindow.js where I am getting error…invalid argument

if (body.offsetWidth > win.clientWidth){body.style.width = win.clientWidth*2-body.offsetWidth+“px”};

this is How initialized my window…
var underscore = {
position: function (element) {
var p = {x: element.offsetLeft || 0, y:element.offsetTop || 0};
while (element = element.offsetParent) {
p.x += element.offsetLeft;
p.y += element.offsetTop;
}
return p;
},
positionCenter: function(element) {
var scrollTop = $(window).scrollTop();
var scrollLeft = $(window).scrollLeft();
var winHeight = $(window).height();
var winWidth = $(window).width();
var end={endTop : 0, endLeft : 0};
end.endTop = scrollTop+((winHeight-550)/ 2);
end.endLeft = scrollLeft+((winWidth -1000)/ 2);
return end;
}
}
function selPickList(){
var id = “PickList”;
dhxWins= new dhtmlXWindows();
dhxWins.enableAutoViewport(true);
dhxWins.setImagePath(“dhtmlxWindows/codebase/imgs/”);
var p = underscore.positionCenter(obj);
win = dhxWins.createWindow(id ,p.endLeft,p.endTop,1000,550);
win.setText("Select PickList for ");
}

this is working fine for firefox but giving error in IE6
:cry: Please help

Could you provide a complete demo to recreate the problem ?

In my application there is a link through which I call function selPickList for creating the window. Inside it one page is coming. For the same window park up and close button is working fine in IE6.
but when we click on maximise window disappears and one javascript error msg comes saying Illegle argument line 69.

Some How I figured out the problem that all the apis for creating dhtmlxwindow is includede in the body of the html page. but why it is working fine in firefox. Now My question is can we make is work in IE6 also for the same case because I can not include the apis outside the body. Please let me know the solution.

We need the complete demo to reproduce the problem.

Do you ue the latest version of the component ?

by removing this line from the html page it started working. Please let me know any alternative for it…

I am attaching a zip file. which contains two html test.html and test2.html. In test2.html I changed the html definition and recreated the problem while in test.html with normal html definition it is working file. Please check.
dhtmlxWindows_demo.zip (47.4 KB)

Try to add the following css class in your page to solve the problem:

<style> html,body{ height:100%; width:100%; margin:0px } </style>

Thanks Alexandra It works. Here one more question I have different links for opening each dhtmlxwindow at different places, but when we maximise these window It maximises at the top of the page. can we make it maximise in the same place?

attaching the demo example for the senario. Please check the test2.html
dhtmlxWindows_demo.zip (48.4 KB)

You may try to use the following approach to define custom position for the window after it is maximized:

dhxWins.window(id).button(“minmax1”).attachEvent(“onClick”,function(win){
win.maximize();
win.setPosition(0,p.y+100); /in your sample p.y+100 is the position where window is created/
})

Thanks Alexandra It is a great help. but after adding the style html,body{ height:100%;width:100%;margin:0px; } I noticed one change in Firefox and browsers other than IE6, now it in not positioning correctly. although p.y is changing but still it is positioning wrongly in firefox. Please check the same demo in firefox, you will see the problem. once again thanks a lot for you quick response.

Try to use the following function for window positioning:

function setPosition(w){ w.centerOnScreen(); var pos = w.getPosition(); w.setPosition(pos[0],pos[1]+document.documentElement.scrollTop); }

Call it after the window is created.

... win.attachURL("http://www.google.co.in"); setPosition(win);

and after the window is maximized:

dhxWins.window(id).button("minmax1").attachEvent("onClick",function(win){ win.maximize(); setPosition(win); return false; })

Hi ,

I think
w.centerOnScreen();
var pos = w.getPosition();

some thing from this code is not working in safari.because it is not maximising the window to center. Please refer the demo zip file.

Thanks

Try to use the following to correct window position:

win.attachEvent("onMaximize",function(){ var scrollTop = (window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop) this.setPosition(0,scrollTop) })