extjs 常用控件的使用 table layout
2016-06-02 00:00
369 查看
用户信息添加的表单
下面有源码下载地址!!!
效果图:
设置frame:false的效果:
复选控件的使用:
单选控件的使用:
效果图:
标签页的使用:
效果图:
HTML控件的使用:
效果图:
源码下载地址:http://download.csdn.net/detail/xu982604405/7338885
下面有源码下载地址!!!
Ext.onReady(function() { //定义下拉框中的值 var store = Ext.create('Ext.data.Store', { fields: ['name', 'value'], data: [{ name:'1', value:'男' }, { name:'0', value:'女' }] }); Ext.create('Ext.form.Panel', { title: '添加人员信息', // 设置表单的宽和高 width: 500, height: 400, frame:true, //采用渲染 floating: true,//居中对齐 draggable: true, renderTo: Ext.getBody(), bodyBorder:true,//加边框 bodyStyle: 'padding:10px', layout: { type: 'table', //采用表格布局,每行3列 columns:3, }, bbar: ['->', //底部设计,偏右 { xtype: 'button', text: '确定' , width:80, style:'background-color:white;margin:10px;' }], defaults: { labelWidth: 70, width: 240, colspan:2, labelAlign: 'left' }, items: [ { colspan:1, width: 240, xtype: 'textfield', fieldLabel: '姓名' }, { rowspan:1, colspan:1, xtype: 'label', text: '个人照片:' },{ rowspan:7, colspan:1, height:200, width:150, fieldLabel:'fsdfs', xtype:'component', autoEl:{ tag: 'img', //指定为img标签 src: 'images/touxiang.jpg' //指定url路径 ,一般为相对路径 } }, { xtype: 'numberfield', fieldLabel: '年龄', decimalPrecision: 0 }, { xtype: 'datefield', fieldLabel: '出生日期', format: 'Y-m-d', value: new Date() },{ xtype:'textfield', fieldLabel:'联系电话', },{ xtype:'textfield', regex:'[0-9]{11}', fieldLabel:'手机号码' },{ xtype:'textfield', fieldLabel:'电子邮箱', vtype:'email' }, { xtype: 'combo', fieldLabel: '性别', store: store, displayField: 'value', valueField: 'name', queryMode: 'local', editable:'false' },{ colspan:3, width:480, xtype:'textfield', fieldLabel:'身份证', },{ colspan:3, width:480, xtype:'textfield', fieldLabel:'具体地址', },{ colspan:3, width:480, xtype:'textfield', fieldLabel:'职位', }] }) })
效果图:
设置frame:false的效果:
复选控件的使用:
{ xtype: 'checkboxgroup', fieldLabel: '复选控件', items: [{ boxLabel: '电影', name:'rb1', inputValue: '0' }, { boxLabel: '音乐', name:'rb1', inputValue: '1' }, { boxLabel: '游戏', name:'rb1', inputValue: '0' }, { boxLabel: '上网', name:'rb1', inputValue: '0' }] }
单选控件的使用:
{ xtype: 'radiogroup', fieldLabel: '单选控件', items: [{ boxLabel: '男', name:'rb', inputValue: '0' }, { boxLabel: '女', name:'rb', inputValue: '1' }] }
效果图:
标签页的使用:
{ xtype: 'fieldset', title: '标签页', items: [{ xtype: 'panel', title: '标签页中的面板', html: '这是内容', height: 80 }] }
效果图:
HTML控件的使用:
{ xtype: 'htmleditor', fieldLabel: 'HTML控件', height: 150 }
效果图:
源码下载地址:http://download.csdn.net/detail/xu982604405/7338885
相关文章推荐
- javascript 模拟开源中国IT技能页面
- javascript(十) Window/JS操作
- 跟我学《JavaScript高程3》视频教程,下载地址
- 跟我学《JavaScript高程3》第一讲,课程笔记
- Javascript面试题浅析
- JsonPath解析Json数据
- Js创建对象的方式
- JavaScript 语言基础知识点总结(思维导图)
- JavaScript Debugging
- JavaScript Array.splice方法替换问题
- JSP_ JSP的7个动作指令
- JavaScript:时间与日期
- 谈谈javascript中设计模式第一篇
- 嵌套json的查询
- JavaScript提交form表单
- JSP_JSP的9大内置对象
- JS学习21(离线应用与客户端储存)
- 嵌套json
- JS里星星评价
- JavaScript中函数的定义方式