Extjs布局
2015-06-28 10:38
711 查看
newinfo.js
html:
工程架构视图:
最终效果图:
Ext.onReady(function() { var list = [['语文', '语文'], ['数学', '数学'], ['英语', '英语']]; var store = new Ext.data.SimpleStore({ fields : ['value', 'text'], data : list }); var combo = new Ext.form.ComboBox({ fieldLabel : '科目', name : 'combo', id:'subject', store : store, displayField : 'text', valueField : 'value', mode : 'local', allowBlank : false }); var panel = new Ext.Panel({ renderTo : Ext.getBody(), width : 800, height : 110, layout : 'border', items : [{ region : 'west', width : 600, xtype : 'fieldset', title : '信息', items : [{ layout:'form', border:false, items:[{ layout : 'column', items : [{ columnWidth:0.35, xtype : 'form', border : false, labelWidth:30, items : combo }, { columnWidth:0.65, xtype : 'radiogroup', id:'sex', items : [{ fieldLabel : '性别', boxLabel : '男', name : 'radio', value : '1', checked : true }, { boxLabel : '女', inputValue:'女', name : 'radio', value : '2' }] }] },{ // 第二行 layout : 'column', items : [{ columnWidth : 0.75, layout : 'form', border : false, labelWidth:40, items : [{ xtype : 'textfield', fieldLabel : '分数', name : 'score', id:'score', emptyText : '输入分数' }] }, { columnWidth : 0.25, layout : 'form', border : false, items:[{ xtype : 'button', text : '打开' }] }] }] }] }, { region : 'center', width : 200, layout : 'column', items : [{ columnWidth : 0.33, items : [{ xtype : 'panel', border : false, height : 110 }] }, { columnWidth : 0.33, layout : 'form', border:false, items:[{ xtype : 'button', text : '确定', width : 100, height : 20, handler: function(){ var location=Ext.getCmp("score").getValue(); var subject=Ext.getCmp("subject").getValue(); var choices=Ext.getCmp("sex").items['items']; for(var i=0;i<choices.length;i++) { if(choices[i].checked) { var sex=choices[i].boxLabel; } } alert(location+"\t"+subject+"\t"+sex); } }, { xtype : 'panel', border : false, height : 60 }, { xtype : 'form', border:false, items : [{ xtype:'button', text : '取消', width : 100, height : 20 }] }] }, { columnWidth : 0.33, items : [{ xtype: 'panel', border : false, height : 110 }] }] }] }); });
html:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>My Extjs Guide</title> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"/> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all.js"></script> <script type="text/javascript" src="./js/newinfo.js"></script> </head> <body> </body> </html>
工程架构视图:
最终效果图:
相关文章推荐
- javascript中遇到的字符串对象处理
- js类型判断的方法
- Js学习文件上传
- 最简单的处理MVC中默认的Json方法返回时间的问题
- 100多个基础常用JS函数和语法集合大全
- 【HM】第3课:JavaScript高级
- JS的碰撞周期移动
- JSON处理
- 在JSP前台和后台传递参数乱码汇总
- 11. Firefox如何调试js脚本:
- Array的队列方法&重排序方法—— JS学习笔记2015-6-27(第68天)
- js 函数的参数 问题 arguments对象 及闭包
- JavaScript语法 (顺序+判断+选择+循环+其他=五种语句)演示
- Web 开发的 JavaScript 框架资料收集(15款)
- 谈谈Ext JS的组件——布局的使用方法续二
- 谈谈Ext JS的组件――布局的使用方法续二
- 谈谈Ext JS的组件——布局的使用方法续二
- 谈谈Ext JS的组件——布局的使用方法续二
- 谈谈Ext JS的组件——布局的使用方法续二
- Js取数组中最大值和最小值