当已设置 autoHeight 时,Ext js 动态设置网格高度的问题

发布于 2024-09-26 12:29:26 字数 533 浏览 0 评论 0原文

当初始设置的自动高度为 true 时,我试图切换网格的高度。 我希望能够在网格变得大于浏览器视图时切换高度。

网格位于没有外部视口的普通页面上。

如果我尝试设置这样的高度,那么我就会松开滚动条。 我可以在 firebug 中看到溢出设置为可见而不是自动。 我怎样才能改变这一点?

mygrid.autoHeight=false;
mygrid.setHeight(200);

如果我在网格的初始设置中将 autoHeight 设置为 true,则我无法确定行所需的高度。

有人可能有这个问题的解决方案/解决方法吗?

谢谢你的建议,理查德

编辑

我认为这会起作用

var scroller = Ext.select("#grid-rekovz div.x-grid3-scroller");
scroller.setStyle('overflow-y','auto');

I am trying to toggle the height off a grid when the initial setup has autoheight is true.
I want to be able to toggle the height when the grid becomes bigger then the browser view.

The grid is on a normal page without an ext viewport.

If I try setting a height like this, then I loose the scrollbar.
I can see in firebug that the overflow is set to visible instead off auto.
How can I change that?

mygrid.autoHeight=false;
mygrid.setHeight(200);

If I leave autoHeight is true out of the initial setup of the grid, I have no way to determine the height it needs for the rows.

Does anyone possibly have a solution/workaround for this problem?

Thanks in adv, Richard

EDIT

I think this will work

var scroller = Ext.select("#grid-rekovz div.x-grid3-scroller");
scroller.setStyle('overflow-y','auto');

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悍妇囚夫 2024-10-03 12:29:26

如果您使用 autoHeight:true;然后你将高度计算问题委托给浏览器,这样你就失去了对它的控制。如果您使用autoHeight:false;那么您可以根据需要更改高度,但如果内容大于指定区域,浏览器将不会向内容添加滚动条。

If you use autoHeight:true; then you delegate height calculating problems to browser, so you lose control of it. If you use autoHeight:false; then you can change height as you wish, but browser will not added scrollbar to content if it became larger than assigned area.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文