Complex Layout resizing Problems - Ext JS

讨论了一个使用特定布局的Web应用程序,在浏览器窗口大小变化时如何保持元素间的百分比宽度分配。提出了自定义面板类来监听布局事件并动态调整子元素大小的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
Reply With Quote
  #2  
Old 03-15-2007, 03:18 AM
DefaultURL

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
Reply With Quote
  #3  
Old 03-15-2007, 05:39 AM
Default

What "breaks"?
Reply With Quote
  #4  
Old 03-15-2007, 05:51 AM
Default

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.
Reply With Quote
  #5  
Old 03-15-2007, 06:43 AM
Default

"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.
Reply With Quote
  #6  
Old 03-15-2007, 06:50 AM
Default

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
Reply With Quote
  #7  
Old 03-15-2007, 06:53 AM
Default

You can't specify widths in %ages.
Reply With Quote
  #8  
Old 03-15-2007, 06:59 AM
Default

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 ...)
Reply With Quote
  #9  
Old 03-15-2007, 07:12 AM
Default

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.
Reply With Quote
  #10  
Old 03-15-2007, 07:19 AM
Default

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
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值