treegrid center and set distance from top

We are using DhtmlxWindows together with DhtmlTreeGrid. The whole page is centered in the browser, and we would like to center the windows on page but want to set the distance in pixels from top where the windows will appear.



Today we use a

to set a viewport, but the the window disapear when moving. We would liek to open several windows and move the beside eachother.



What we want to know is:



IS there a way to use default viewport settings (all of the browser area) and center the windows horizontal and set number of pixels from top.


Hello,


You can try to use both center() and setPosition(x,y) methods. center() can be applied for centering horizontally, setPosition to set vertical position:


win.center();
win.setPosition(null,vertical_offset);


Please, use attached dhtmlxwindows.js. We’ve made some modifications in it to make the described approach possible.







dhtmlxwindows.zip (16.4 KB)


Ive just replaced the file and added the code, but it doesnt seem to work for me, here is a snippet of the



Mabye, I`ve done something wrong here



var dhxWins = new dhtmlXWindows();
        dhxWins.enableAutoViewport(false);
        dhxWins.attachViewportTo(“window_containe”);
        dhxWins.setImagePath(“dhtmlsuite/dhtmlxWindows/codebase/imgs/”);
        dhxWins.setEffect(“move”, true);
        dhxWins.setEffect(“resize”, true);   
 var w1 = dhxWins.createWindow(“w1”, 380, 100, 950, 520);
        w1.setText(“Details”);
        w1.button(“close”).enable();
        w1.keepInViewport(true);
        w1.center();
        w1.setPosition(null,100);

        dhxWins.window(“w1”).setModal(false);
        dhxWins.window(“w1”).bringToTop();



        dhxWins.window(“w1”).attachURL(“details.php?id=”+rowID.substr(1));
        dhxWins.attachEvent(“onFocus”, function(w) {
        dhxWins.window(“w1”).bringToTop();
 });
 
        dhxWins.window(“w1”).attachEvent(“onClose”, function() {



        dhxWins.window(“w1”).hide();
        mygrid.updateFromXML(‘data.php’);
     });