




已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Extjs4.1中布局的组合使用Extjs4.1中布局很经典,也很好用,关键是如何组合布局,组合布局,不仅要达到我们想要的界面效果,还要注意因为布局所付出的渲染代价。下面是我经过反复调试,总结的最常用也很高效的几种组合布局,废话不多说,先看其中一个效果图:因为Extjs布局本身并没有难度,我也没必要在这浪费口舌说些没用的知识点,下面是详细代码,复制粘贴就可以直接运行(注意引入extjs的包).相信效果会吓你一跳。HTML代码:无标题文档$(document).ready(function()Ext.onReady(function()Ext.require( /Ext.form.*, /Ext.layout.container.Column, /Ext.tab.Panel *);Ext.onReady(function() Ext.QuickTips.init(); var bd = Ext.getBody(); /* * = Simple form = */ bd.createChild(tag: h2, html: Form 1 - Very Simple); var required = *; var simple = Ext.widget(form, layout: form, collapsible: true, id: simpleForm, url: save-form.php, frame: true, title: Simple Form, bodyPadding: 5 5 0, width: 350, fieldDefaults: msgTarget: side, labelWidth: 75 , defaultType: textfield, items: fieldLabel: First Name, afterLabelTextTpl: required, name: first, allowBlank: false , fieldLabel: Last Name, afterLabelTextTpl: required, name: last, allowBlank: false , fieldLabel: Company, name: company , fieldLabel: Email, afterLabelTextTpl: required, name: email, allowBlank: false, vtype:email , fieldLabel: DOB, name: dob, xtype: datefield , fieldLabel: Age, name: age, xtype: numberfield, minValue: 0, maxValue: 100 , xtype: timefield, fieldLabel: Time, name: time, minValue: 8:00am, maxValue: 6:00pm , buttons: text: Save, handler: function() this.up(form).getForm().isValid(); , text: Cancel, handler: function() this.up(form).getForm().reset(); ); simple.render(document.body); /* * = Form 2 = */ bd.createChild(tag: h2, html: Form 2 - Adding fieldsets); var fsf = Ext.widget( xtype: form, id: fieldSetForm, collapsible: true, url: save-form.php, frame: true, title: Simple Form with FieldSets, bodyPadding: 5 5 0,layout: anchor, width: 350, fieldDefaults: msgTarget: side, labelWidth: 75 , defaults: anchor: 100% , items: xtype:fieldset, checkboxToggle:true, title: User Information, defaultType: textfield, collapsed: true, layout: anchor, defaults: anchor: 100% , items : fieldLabel: First Name, afterLabelTextTpl: required, name: first, allowBlank:false , fieldLabel: Last Name, afterLabelTextTpl: required, name: last , fieldLabel: Company, name: company , fieldLabel: Email, afterLabelTextTpl: required, name: email, vtype:email , xtype:fieldset, title: Phone Number, collapsible: true, defaultType: textfield, layout: anchor, defaults: anchor: 100% , items : fieldLabel: Home, name: home, value: (888) 555-1212 , fieldLabel: Business, name: business , fieldLabel: Mobile, name: mobile , fieldLabel: Fax, name: fax , buttons: text: Save , text: Cancel ); fsf.render(document.body); /* * = Form 3 = */ bd.createChild(tag: h2, html: Form 3 - A little more complex); var top = Ext.widget( xtype: form, id: multiColumnForm, collapsible: true, frame: true, title: Multi Column, Nested Layouts and Anchoring, bodyPadding: 5 5 0, width: 600, fieldDefaults: labelAlign: top, msgTarget: side , items: xtype: container, anchor: 100%, layout: hbox, items: xtype: container, flex: 1, layout: anchor, items: xtype:textfield, fieldLabel: First Name, afterLabelTextTpl: required, allowBlank: false, name: first, anchor:95%, value: Don , xtype:textfield, fieldLabel: Company, name: company, anchor:95% , xtype: container, flex: 1, layout: anchor, items: xtype:textfield, fieldLabel: Last Name, afterLabelTextTpl: required, allowBlank: false, name: last, anchor:100%, value: Griffin , xtype:textfield, fieldLabel: Email, afterLabelTextTpl: required, allowBlank: false, name: email, vtype:email, anchor:100% , xtype: htmleditor, name: bio, fieldLabel: Biography, height: 200, anchor: 100% , buttons: text: Save, handler: function() this.up(form).getForm().isValid(); , text: Cancel, handler: function() this.up(form).getForm().reset(); ); top.render(document.body); /* * = Form 4 = */ bd.createChild(tag: h2, html: Form 4 - Forms can be a TabPanel.); var tabs = Ext.widget( xtype: form, id: tabForm, width: 350, border: false, bodyBorder: false, fieldDefaults: labelWidth: 75, msgTarget: side , items: xtype:tabpanel, activeTab: 0, defaults: bodyPadding: 10, layout: anchor , items: title:Personal Details, defaultType: textfield, defaults: anchor: 100% , items: fieldLabel: First Name, name: first, afterLabelTextTpl: required, allowBlank: false, value: Ed , fieldLabel: Last Name, afterLabelTextTpl: required, allowBlank: false, name: last, value: Spencer , fieldLabel: Company, name: company, value: Ext JS , fieldLabel: Email, afterLabelTextTpl: required, allowBlank: false, name: email, vtype:email , title: Phone Numbers, defaultType: textfield, defaults: anchor: 100% , items: fieldLabel: Home, name: home, value: (888) 555-1212 , fieldLabel: Business, name: business , fieldLabel: Mobile, name: mobile , fieldLabel: Fax, name: fax , buttons: text: Save, handler: function() this.up(form).getForm().isValid(); , text: Cancel, handler: function() this.up(form).getForm().reset(); ); tabs.render(document.body); /* * = Form 5 = */ bd.createChild(tag: h2, html: Form 5 - . and forms can contain TabPanel(s); var tab2 = Ext.widget( title: Inner Tabs, xtype: form, id: innerTabsForm, collapsible: true, bodyPadding: 5, width: 600, fieldDefaults: labelAlign: top, msgTarget: side , defaults: anchor: 100% , items: xtype: container, layout:hbox, items: xtype: container, flex: 1, border:false, layout: anchor, defaultType: textfield, items: fieldLabel: First Name, afterLabelTextTpl: required, allowBlank: false, name: first, anchor:95% , fieldLabel: Company, name: company, anchor:95% , xtype: container, flex: 1, layout: anchor, defaultType: textfield, items: fieldLabel: Last Name, afterLabelTextTpl: required, allowBlank: false, name: last, anchor:95% , fieldLabel: Email, afterLabelTextTpl: required, allowBlank: false, name: email, vtype:email, anchor:95% , xtype:tabpanel, plain:true, activeTab: 0, height:235, defaults: bodyPadding: 10 , items: title:Personal Details, defaults: width: 230 , defaultType: textfield, items: fieldLabel: First Name, name: first, value: Jamie , fieldLab
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年稀有稀土金属矿采选行业研究报告及未来行业发展趋势预测
- 2025年鞋行业研究报告及未来行业发展趋势预测
- 餐饮行业供应链整合与成本控制2025年创新模式研究报告
- 2025年滤水器净水器行业研究报告及未来行业发展趋势预测
- 沼气工程在新能源产业链中的应用:2025年技术创新与市场分析报告
- 2025年婴幼儿配方食品营养配方与婴幼儿睡眠质量的关系报告
- 2025年乡村文化旅游项目资金申请政策导向与市场前景报告
- 手卫生知识试题及答案院感手卫生试题及答案
- 2025江西南昌市青云谱实验学校招聘派遣制教师17人岗位考试参考试题及答案解析
- 2026届江苏省常州市田家炳高级中学高三化学第一学期期中达标测试试题含解析
- 2025年轻型民用无人驾驶航空器安全操控(多旋翼)理论备考试题(附答案)
- 2025年护士执业资格考试题库(精神科护理学专项)护理法律法规试题汇编
- 测绘地理信息从业人员保密知识培训
- 医院行风岗前培训
- 智慧水利方案介绍课件(共31张课件)
- 《数据采集系统》课件
- 2024-2030年中国眼镜盒市场发展趋势及前景规划调研报告
- 压疮的预防管理制度
- 危重病人体位管理
- 第八章新时代坚持和发展中国特色社会主义的重要保障-2024版研究生新中特教材课件
- (新版)六西格玛黄带认证考试复习题库(含答案)
评论
0/150
提交评论