Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Nerea on Jan 30, 2009 00:31
open dhtmlx forum
Selected window

I have a problem when I open more than one window form a page.

The action I do is that each time that I park Up a window I calculate the place where It has to be show I I show them on a row at the bottom of the page.

When I parkdown a page and i iterate the dhxWins after doing it my window object is pointing to the last window of this iteration.
Is there a way to give back the window I was using?

Thanks
Nerea

Here is my code:

winload.attachEvent("onParkDown", function(win) { //Al minimizar la ventana situar abajo                    
//Decrementar el contador de minimizadas
numpark = 0;
dhxWins.forEachWindow(function(winP) {

//si está parked eliminamos los espacion entre las que quedan parked    
if ( (winP.getText() != win.getText()) && winP.isParked()){
    //colocar la venta en la posición parked
                            winP.setPosition( 200 * numpark, document.body.clientHeight - 37);
                            //Incrementar el contador de minimizadas
    numpark = ++numpark;                            
}    
});
win.setDimension(winWidth, winHeight);
win.center();
return winload;
});         

winload.attachEvent("onParkUp", function(win) { //al amaximizar ventana centrar
                    
//Incrementar el contador de minimizadas
numpark = ++numpark;                        
                    
win.setDimension(10, 0);
if (numpark == 1){
    win.setPosition( 0, document.body.clientHeight - 37);
}
else{
    win.setPosition( 200 * (numpark-1), document.body.clientHeight - 37);
}
return true;
});

Answer posted by Support on Feb 03, 2009 07:59
Here is a demo.
(Do not forget about repositioning parked windows on close, this is not included in demo)
Attachments (1)
1.zip1008.00 B
Answer posted by Nerea on Feb 03, 2009 08:57

Thanks a lot!

It works ok.

I solved my other problem passing the window's Id to the the next page to handle all its functions.