Hi all,
I have created a complex layout for an application I am working on. Now when I resize the window, they layout breaks. I am most likely doing something wrong, but I can not seem to localize the problem maybe someone here can help?
You can see the layout under the following url:
http://www.fraley.de/yui/selection-alpha.html
Best regards
patrick
I have created a complex layout for an application I am working on. Now when I resize the window, they layout breaks. I am most likely doing something wrong, but I can not seem to localize the problem maybe someone here can help?
You can see the layout under the following url:
http://www.fraley.de/yui/selection-alpha.html
Best regards
patrick

|
#2
|
|
Hi all,
the URL was not working yesterday because the upload took a while, but it is working now. Can anyone help please? Best regards patrick ![]() |
|
#3
|
|
What "breaks"?
![]() |
|
#4
|
|
In the upper part there is a selectionframe with 4 parts (ZG1 thru ZG4) these parts are always supposed to be 25% of the usable width. after resizing (in Safari and FireFox, have not tested IE yet) they get scrambled and some of them don't even show anaymore.
![]() |
|
#5
|
|
"supposed to be"?
What, you want the the browser to read your mind? They're not being scrambled, just hidden if you make the window narrower! If you want to divide up the width into 4 equal parts, you'll have to write some code to do that, and listen for resize events. ![]() |
|
#6
|
|
hey come on my english is not the best.
and yes they are supposed to be, if you look at the code you will see that they are Ext.BorderLayouts with a width of 50% (since you can't divide into 4 equal parts I divide into two and then divide into two again). et voila 25% and since I gave them a size and they are BorderLayouts I would expect them to have a resize listender (works on other BorderLayouts so far), so I guess I expect them to read my mind, or at least stick to the code that came out of my mind ![]() I am not new to JavaScript but new to this library, but as far as I understodd the BorderLayout it will resize them accordingly, maybe I missunderstodd something .... If this does not work the way I expect, could you give me a hint on where to get some info on how to write an observer for the resizing problem??? thanks again patrick ![]() |
|
#7
|
|
You can't specify widths in %ages.
![]() |
|
#8
|
|
mmhh ok, though except for the resizing problems it seems to work with the percent. I guess I will have to figure out another way of doing this ....
is there anywhere documentation on how to dynamically change the size of objects? and how to find the available space (I guess the size of the parent container would be something to start from ...) ![]() |
|
#9
|
|
It would be a new type of Panel. I'd suggest a subclass of ContentPanel which has some kind of config which specifies multiple zones (horiz or vert) and their size (width or height depending on the orientation) as %ages.
It would have to set up a listener listening for the "layout" event of its parent layout, and redo all its calculations. You could then have a getElement(n) method where n is the zone number - 0 to 3 in this case. Sounds like a fun project. ![]() |
|
#10
|
|
hey thanks I guess that points me in the right direction and is what I was thinking about doing eventually anyway's
![]() I will post updates on it here, and maybe someone can use this. I guess it is kind of like the Mac Os X Browser or something. We will see what comes of it ![]() ![]() |
讨论了一个使用特定布局的Web应用程序,在浏览器窗口大小变化时如何保持元素间的百分比宽度分配。提出了自定义面板类来监听布局事件并动态调整子元素大小的方法。
and since I gave them a size and they are BorderLayouts I would expect them to have a resize listender (works on other BorderLayouts so far), so I guess I expect them to read my mind, or at least stick to the code that came out of my mind 
1万+

被折叠的 条评论
为什么被折叠?



