当已设置 autoHeight 时,Ext js 动态设置网格高度的问题
当初始设置的自动高度为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用
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 useautoHeight:false
; then you can change height as you wish, but browser will not added scrollbar to content if it became larger than assigned area.