ExtJS GridPanel 滚动条不会出现在 IE7 中,但会出现在 Firefox 等中
设置
我有一个手风琴布局,其中包含一个嵌套两个内部面板的“属性”面板。第一个内部面板包含一个 Ext.DataView
,而第二个面板是所讨论的 Ext.grid.GridPanel
。在下面的屏幕截图中,包含文件夹图标的空白区域是数据视图,其下方是网格面板。
问题
在 Firefox、Chrome 和 Opera 中,当我的网格面板属性溢出时,会出现一个滚动条。仅在 Internet Explorer 中不会出现。但是,我可以在所有浏览器(包括 IE)中使用鼠标滚动按钮进行滚动。
我也尝试删除我们的自定义 css 文件,以防它以某种方式影响它,但没有任何变化这样做。
我不确定应该显示什么代码,因为我不知道确切的问题来自哪里,但这是主面板和网格面板的代码。
var mainPanel = new Ext.Panel({
id : 'main-property-panel',
title : 'Properties',
height : 350,
autoWidth : true,
tbar : [comboPropertyActions],
items : [panel1] //panel1 holds the DataView
});
var propertiesGrid = new Ext.grid.GridPanel({
stripeRows : true,
height : mainPanel.getSize().height-iconDataView.getSize().height-mainPanel.getFrameHeight(),
autoWidth : true,
store : propertiesStore,
cm : propertiesColumnModel
})
//Add gridpanel to mainPanel
mainPanel.add(propertiesGrid);
mainPanel.doLayout();
任何朝着正确方向的帮助将不胜感激。谢谢。
Setup
I have an accordion layout containing a "properties" panel that nests two inner panels. The first inner panel holds a Ext.DataView
, while the second panel is the Ext.grid.GridPanel
in question. In the screenshot below, the white space containing the folder icon is the dataview, and below that is the gridpanel.
Problem
In Firefox, Chrome, and Opera, there is a scrollbar that appears when my gridpanel has an overflow of properties. It is only in Internet Explorer that it does not appear. I am, however, able to scroll using my mouse scroll button in all browsers, including IE.
I've also tried removing our custom css file in case it was affecting it somehow, but there was no change in doing so.
I'm not sure exactly what code I should show as I don't know where the exact problem is coming from but here is the code for the mainpanel and gridpanel.
var mainPanel = new Ext.Panel({
id : 'main-property-panel',
title : 'Properties',
height : 350,
autoWidth : true,
tbar : [comboPropertyActions],
items : [panel1] //panel1 holds the DataView
});
var propertiesGrid = new Ext.grid.GridPanel({
stripeRows : true,
height : mainPanel.getSize().height-iconDataView.getSize().height-mainPanel.getFrameHeight(),
autoWidth : true,
store : propertiesStore,
cm : propertiesColumnModel
})
//Add gridpanel to mainPanel
mainPanel.add(propertiesGrid);
mainPanel.doLayout();
Any help into the right direction would be greatly appreciated. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我对这个问题的解决方案是从我的 gridpanel 配置中删除
autoWidth : true
。相反,我手动设置宽度值,并使用一个函数在属性面板主体调整大小时更改网格面板的高度和宽度。下面是我修改后的代码以及当属性面板的宽度和高度发生变化时手动设置网格面板大小的函数。感谢大家的帮助!
My solution for this problem was removing
autoWidth : true
from my gridpanel config. Instead, I manually set a width value and have a function change the gridpanel's height and width on the property panel's body resize. Below is my modified code along with the function to manually set the size of my gridpanel when the property panel's width and height changes.Thanks all for your help!
如果调整大小/隐藏/显示面板,滚动条是否会出现?如果是这样,则可能是 IE hasLayout 问题。如果不是,则可能是您的布局存在问题(或者可能是 Ext bug)。从您发布的内容中很难看出任何内容。您在 Ext 论坛上提问过吗?
对于这样的事情,我通常会尝试系统地将代码削减回仍然显示问题的最小可能布局。如果确实是某种配置问题,这通常会导致人们发现自己的问题。但至少(因为你的示例确实可以在除 IE 之外的所有平台上运行,所以配置可能没问题),这将使其他人更容易查看并尝试重现该问题。
Does the scrollbar appear if you resize/hide/show the panel? If so, it could be an IE hasLayout issue. If not, it's likely an issue with your layout (or possibly an Ext bug). Hard to tell anything from what you've posted. Have you asked on the Ext forums?
For things like this, I usually try to systematically cut the code back to the smallest possible layout that still shows the issue. This often leads people to finding their own issues if indeed it is a configuration issue of some sort. But at the very least (since your example does work in everything but IE, the config is probably fine) it will make it much easier for someone else to look at and try to reproduce the issue.
我确信我已经找到了更好、更简单的解决方案。只需将
width
和height
设置为'100%'
即可:在创建
Ext.grid.Panel
时。我回答这个老问题是因为这是你在谷歌搜索时得到的第一个问题。
I'm sure I've found much better and easier solution. Just set the
width
andheight
to'100%'
like that:when creating the
Ext.grid.Panel
.I'm answering such an old question because it is the first one you get when searching on google.