ext2.0中layout布局(6)
来源:互联网 发布:linux 关闭所有防火墙 编辑:程序博客网 时间:2024/06/03 21:06
1.ExtJS一共包含十种布局,常用的布局有border、column、fit、form、card、tabel等布局
column布局:
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",width:400,height:200,layout:"column",items:[{columnWidth:.5,title:"面板1"},{columnWidth:.5,title:"面板2"}]});});
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",layout:"column",width:500,height:100,items:[{title:"列1",width:100},{title:"列2",width:200},{title:"列3",width:100},{title:"列4"} ]});});
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",layout:"column",width:500,height:100,items:[{title:"列1",columnWidth:.2},{title:"列2",columnWidth:.3},{title:"列3",columnWidth:.3},{title:"列4",columnWidth:.2} ]});});
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",layout:"column",width:500,height:100,items:[{title:"列1",width:200},{title:"列2",columnWidth:.3},{title:"列3",columnWidth:.3},{title:"列4",columnWidth:.4}] });});
border布局:
Ext.onReady(function(){new Ext.Viewport({layout:"border",items:[{region:"north",height:50,title:"顶部面板"},{region:"south",height:50,title:"底部面板"},{region:"center",title:"中央面板"},{region:"west",width:100,title:"左边面板"},{region:"east",width:100,title:"右边面板"}]});});
Fit 布局:
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",layout:"fit",width:500,height:100,items:[{title:"子元素",html:"这是子元素中的内容"}] });});
比较上诉和下面的代码的效果:
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",width:500,height:200,items:[{title:"子元素",html:"这是子元素中的内容"},{title:"子元素22",html:"2222222222222222"}] });});
Form 布局由类Ext.layout.FormLayout 定义,名称为form,是一种专门用于管理表单中输入字段的布局,
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",width:300,layout:"form",hideLabels:false,labelAlign:"right",height:120,defaultType: 'textfield',items:[{fieldLabel:"请输入姓名",name:"name"},{fieldLabel:"请输入地址",name:"address"},{fieldLabel:"请输入电话",name:"tel"}] });});在父容器中还通过hideLabels、labelAlign 等配置属性来定义了是否隐藏标签、标签对齐方式等
Accordion 布局
Ext.onReady(function(){new Ext.Panel({renderTo:"hello",title:"容器组件",width:500,height:200,layout:"accordion",layoutConfig: {animate: true},items:[{title:"子元素1",html:"这是子元素1中的内容"},{title:"子元素2",html:"这是子元素2中的内容"},{title:"子元素3",html:"这是子元素3中的内容"}]});});
Ext.onReady(function(){var panel=new Ext.Panel({renderTo:"hello",title:"容器组件",width:500,height:200,layout:"table",layoutConfig: {columns: 3},items:[{title:"子元素1",html:"这是子元素1中的内容",rowspan:2,height:100},{title:"子元素2",html:"这是子元素2中的内容",colspan:2},{title:"子元素3",html:"这是子元素3中的内容"},{title:"子元素4",html:"这是子元素4中的内容"}] });});
- ext2.0中layout布局(6)
- Ext2 中如何换行 布局?
- Ext2.0布局类初探
- Ext2.0布局类初探
- iOS 中 Auto Layout(自动布局)
- ext2.0中组件简介(2)
- ext2.0中GridPanel(7)
- ext2.0中EditorGridPanel (8)
- Ext 布局(layout)
- EasyUI -- Layout(布局)
- ExtJS中layout布局详解
- (转载)EXT2文件系统内部布局
- (转载)Ext2 文件系统的硬盘布局
- 布局(线性布局 Linear Layout )相对布局 (Relative Layout)
- wxFormbuileder中wxwidgets的布局控件(layout)的使用
- ext2.0中组件(viewPort)的使用(4)
- ext2.0中Record的使用(9)
- ext2文件系统存储布局
- LeetCode:Single Number II
- Parse CSV file with Groovy
- 如何限制UITextView上文字的长度
- FreeType编译及使用心得
- 支持GIF动画的ImageView
- ext2.0中layout布局(6)
- HDU 4118Time travel 概率dp+gauss消元
- ubuntu12.04安装eclipse
- SharePoint咨询师之路:设计之前的那些事二:规模
- 视频码率,帧率和分辨率的联系与区别
- OCP-1Z0-053-V12.02-643题
- 关于u盘量产工具
- [Urgent]Technical Support Engineer - 2013/10/14
- log4j layouts