Grid layout trouble - Ext JS

作者在使用ExtJS框架时遇到了网格布局问题,特别是在不同浏览器下出现滚动条覆盖内容及布局错位的情况。通过社区的帮助,作者尝试了不同的doctype声明,并最终采用GridPanel组件解决了布局问题。

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

Hi folks,

I have mentioned now and then here that I have some problems with my grid to behave correctly in regards to layout. I had somehow hoped that those problems would miraculously vanish on one of the updates, but so far in vain
I have a BorderLayout and the grid forms the content of the center pane. Troubles start when the grid doesn't fit into the panel. Here is a screenshot of what happens when I first load my app:


http://img155.imageshack.us/my.php?i...troubletp5.jpg

As you can see the grid doesn't fit horizontally, so a scroll bar appears, but it overlays the grid itself. Also an (unnecessary) wrongly positioned vertical scrollbar appears. If I resize the browser viewport (opening FireBug comes to mind ), the grid stays as is and the lower part just disappears.
I can "fix" that by using autoScroll: true for the panel, but then the whole (oversized) grid is scrolled within the panel. What I want is the grid to manage scrolling like in the paging example (ie only scrolling the contents without header and paging footer).
As I'm at my wit's (and limitied JS knowledge's) end, I'm open for any input/help/comment :?
Reply With Quote
  #2  
Old 02-25-2007, 05:22 AM
Default

What's you doc type and what browser is the problem in?
Reply With Quote
  #3  
Old 02-25-2007, 09:36 AM
Default

Firefox 2.0.0.2 and originally
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
after I read your post I also tried
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/DTD/loose.dtd">
and xhtml transitional, but it still looks the same.
Reply With Quote
  #4  
Old 02-25-2007, 10:09 AM
Default

No sure, let me investigate.
Reply With Quote
  #5  
Old 02-25-2007, 11:37 AM
Default

Are you putting the grid in a ContentPanel, or creating a GridPanel from the grid?
Reply With Quote
  #6  
Old 02-25-2007, 02:04 PM
Default

Quote:
Originally Posted by Animal
Are you putting the grid in a ContentPanel, or creating a GridPanel from the grid?
Currently the grid is attached to a separate div within the div used for the panel.
I've tried to attach the grid to the same div that I used to create the panel, but the effect was the almost the same, only the horizontal scrollbar that should be there is gone now (probably overwritten by a content refresh). The vertical bar (that shouldn't be there) is still there and positioned as seen in the screenshot.
Reply With Quote
  #7  
Old 02-25-2007, 02:10 PM
Default

Nice question Animal! You need to use a GridPanel or you are in charge of fixing all the stuff that a GridPanel does. Did you implement all that stuff?
Reply With Quote
  #8  
Old 02-25-2007, 04:12 PM
Default

AAAH! I had missed GridPanel :oops:

It still doesn't work, but need to investigate first whether something I did to try to fix the problem now messes things up. Thanks a lot.
Reply With Quote
  #9  
Old 02-25-2007, 05:21 PM
Default

After upgrading to rev4 and fiddeleing with the order of setting things up everything works perfectly!
Thanks again!
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值