ExtJS Tab里放Grid高度自适应问题,官方Perfect方案。

出处:http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/layout-browser/layouts/combination.js

// A common mistake when adding grids to a layout is creating a panel first,
// then adding the grid to it. GridPanel (xtype:'grid') is a Panel subclass,
// so you can add it directly as an item into a container. Typically you will
// want to specify layout:'fit' on GridPanels so that they'll size along with
// their container and take up the available space.

 

大致意思是Grid是Panel的子类,不需要用Panel再包Grid了,这样做的话,会导致Grid的Fit布局,不能奏效了。

示例页面:http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/layout-browser/layout-browser.html

选左边树上的Combination Examples下的Tabs With Nested Layouts

选Foo页的Inner Tab 2,这下边有个“下置标签选项卡”,再选择“Nested Grid”,就能Grid自适应的效果。

 

注意:因为Panel有closable属性,Grid是子类,当然也有啦。原来Grid也是可以“关闭”的啊!

posted @   任国强  阅读(2636)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示