View Full Version : Multiple Viewports
Robert Sayfullin
12 Feb 2008, 3:47 PM
Hi all
I am looking for a multiple virtual desktops solution similar to Gnome. http://extjs.com/forum/attachment.php?attachmentid=4475&stc=1&d=1202859949
When you fill one desktop with 100 floating windows you should be able to switch to other (clean) desktop and start messing there :)
http://extjs.com/forum/attachment.php?attachmentid=4476&stc=1&d=1202859949
Is there a way of having more than one Viewport?
brian.moeskau
12 Feb 2008, 4:00 PM
No, but you can have one Viewport with a CardLayout. However, "replicating Gnome" in a browser is probably not going to result in a speedy page if you get enough stuff open.
Robert Sayfullin
12 Feb 2008, 4:20 PM
Thank you Brian!
However, "replicating Gnome" in a browser is probably not going to result in a speedy page if you get enough stuff open.
Can you suggest any other approach of having multiple floating windows arbitrary separated in groups and User should be able to show/hide entire group?
brian.moeskau
12 Feb 2008, 4:44 PM
For what you want to do, that is the best approach. I'm just saying that there are limitations inherent in a browser-based app that you're going to run into when replicating an OS style environment, regardless of your approach. If you're planning on "hundreds" of windows you might be disappointed. ;)
Robert Sayfullin
12 Feb 2008, 7:57 PM
Dear Brian, It generally works. I can create widgets in current 'desktop' and switch between them. But when I move widget from one desktop to another with :
win.hide();
desktops[oldDesk].remove(win);
desktops[newDesk].add(win);
win.show();
desktops[newDesk].doLayout(); the Widget appears in new desktop but loses all guts (grids, buttons, etc) and renders only outer Ext.Window. Moreover the window become not movable. Will really appreciate your advice.
Robert Sayfullin
12 Feb 2008, 9:12 PM
Well, some more elaboration.. Adding don't destroy parameter to remove helped slightly:
moveWindowToDesktop:function(win, n){
win.hide();
win.ownerCt.remove(win.getEl(), false);
desktops[n].add(win.getEl());
win.show();
desktops[n].doLayout();
},
Now widget renders its guts and they are fully functional. However trying to move window lead to unpredictable positioning on the screen, often out of visible part. Resize of browser brings floating window to 0,0 position. As I understand, container knows about new window but window does not and tries to position itself inside .. not sure what...
bpjohnson
13 Feb 2008, 10:00 AM
A different approach may be to use one desktop, but multiple windowgroups. Then when you want to switch "virtual desktops" you just hide all the windows in the current group and show the windows in the new group. Of course, you may have to do some gymnastics if you want to preserve minimization when switching between your windowgroups / "virtual desktops."
Robert Sayfullin
13 Feb 2008, 4:16 PM
I am not sure I am getting it right.. When window is moved to new container it still has it's resize proxy (<id>-rzproxy) inside previous container. Consequently resize operation breaks. This ugly hack seems to fix it :
win.hide();
if (win.resizable) {
desktops[n].add(Ext.get(win.id + '-rzproxy'));
}
desktops[n].add(win);
desktops[n].doLayout();
win.container = desktops[n].body;
win.show(); So, first I had to move manually rzproxy to the same same container. Also win.container = desktops[n].body; is needed for for correct positioning with DD. Without this win.container points to previous container.. Hm.. I believe there is a proper way how to move windows between containers.. that I am not aware of. Can anyone help me with that?
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.