Extjs.FormPanel
刚刚学习ExtJS ,备注一哈代码 防止忘记。。。
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="resources/css/ext-all.css" rel="stylesheet" />
<script src="JS/ext-all.js"></script>
<script src="JS/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
Ext.onReady(function () {
Ext.QuickTips.init();//支持Tips提示
Ext.form.Field.prototype.megTarget = 'side';//提示的方式
Ext.apply(Ext.form.VTypes, {
password: function(val, field) {
if (field.confirmTo) {
var pwd = Ext.get(field.confirmTo);
return (val == pwd.getValue());
}
return true;
}
});
var form1 = new Ext.form.FormPanel({
width: 400,autoHeight:true,
renderTo: "myform",
frame: true,
title: "用户信息",
items: [{
xtype: "fieldset",
checkboxToggle: true,
checkboxName: "checkInfo",
title: "选填信息",
defaultType: "textfield",
width: 380,
autoHeight: true,
items: [{
name: "UserName",
id: "UserName",
fieldLabel: "用户名称",
xtype: "textfield",
emptyText: "请输入用户名称!",
anchor:"96%"
}, {
name: "UserPwd",
id: "UserPwd",
fieldLabel: "用户密码",
xtype: "textfield",
emptyText: "请输入用户密码!",
inputType: "password", //输入的类型
anchor: "96%",
allowBlank: false,//是否允许为空
blankText:"密码不能为空!" },
{
fieldLabel: "确认密码",
id: "confirmpass",
name: "confirmpass",
inputType: "password", //输入的类型
vtype: "password",
vtypeText: "两次输入的密码不一至!",
confirmTo: "UserPwd",
anchor:"96%"
},
{
fieldLabel: "Emial",
vtype: "email",
vtypeText: "不是有效的邮箱地址!",
name:"txtEmial",
anchor:"96%"
}
]
}
, { xtype: "fieldset",
collapsible: true,
title:"详细信息",
width: 380,
defaultType: "textfield",
items: [{
fieldLabel: "爱好",
name: "hbody",
value: '呵呵 上网',
anchor: "96%" }, {
xtype: "combo",
name: "sex",
store: ["男", "女", "保密"],
fieldLabel: "性别",
anchor:"96%",
emptyText: "请选择姓别"
}]
}
,
{
xtype: "fieldset",
title: "业务爱好",
width: 380,
labelWidth: 100,
labelAlign:"left",
autoHeight: true,
items: [
{
frame:true,
xtype: "panel",
layout: "column",
fieldLable: "爱好",
items: [
{
columnWidth: 2,
xtype: "checkbox",
boxLabel: "足球"
},
{
columnWidth: 2,
xtype: "checkbox",
boxLabel: "篮球"
},
{
columnWidth: 2,
xtype: "checkbox",
boxLabel: "乒乓球"
},
{
columnWidth: 2,
xtype: "checkbox",
boxLabel: "羽毛球"
}, ,
{
columnWidth: 2,
xtype: "checkbox",
boxLabel: "排球",
checked:true
}
]
}
]
}
],
buttonAlign: "center",
buttons:[{text:"确认"},{text:"取消"}]
}); });
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="myform"> </div>
</form>
</body>
</html>
Extjs.FormPanel的更多相关文章
- ExtJS FormPanel不执行校验
经检查问题原因在于使用了 validator 属性. 使用validator属性,必须添加返回值.不添加返回值,就会出现FormPanel不执行校验的问题.
- ExtJs FormPanel布局
FormPanel有两种布局:form和column,form是纵向布局,column为横向布局.默认为后者.使用layout属性定义布局类型.对于一个复杂的布局表单,最重要的是正确分割,分割结果直接 ...
- Javascript - 学习总目录
Javascript - 操作符 Javascript - 数据类型 Javascrip - 语句 Javascript - 函数 Javascript - 预编译与函数词法作用域 Javascrip ...
- 无废话ExtJs 入门教程四[表单:FormPanel]
无废话ExtJs 入门教程四[表单:FormPanel] extjs技术交流,欢迎加群(201926085) 继上一节内容,我们在窗体里加了个表单.如下所示代码区的第28行位置,items:form. ...
- Extjs关于FormPanel布局
Extjs关于FormPanel布局 FormPanel有两种布局:form和column,form是纵向布局,column为横向布局.默认为后者.使用layout属性定义布局类型.对于一个复杂的布局 ...
- 【ExtJS】FormPanel表单验证
在Extjs中,FormPane表单提供了各种各样的验证. 在表单验证前需要在onReady的function({})内添加以下代码: Ext.QuickTips.init(); //为组件提供 ...
- 【ExtJS】 FormPanel与ComboBox的集成以及值的获取
var formPanel = Ext.create("Ext.form.Panel",{ title : 'formPanel', width : 400, url : 'asd ...
- ExtJs 使用点滴 十三 在FormPanel 嵌入按钮
Ext.onReady(function () { //初始化标签中的Ext:Qtip属性. Ext.QuickTips.init(); Ext.form.Field.prototype.msgTar ...
- ExtJs学习笔记之FormPanel组件
FormPanel组件 FormPanel 为 form 表单提供了一个标准的容器. 本质上还是一个标准的 Ext.panel.Panel, 只是自动创建了一个 BasicForm 来管理所有添加到 ...
随机推荐
- Python黑帽编程2.1 Python编程哲学
Python黑帽编程2.1 Python编程哲学 本节的内容有些趣味性,涉及到很多人为什么会选择Python,为什么会喜欢这门语言.我带大家膜拜下Python作者的Python之禅,然后再来了解下P ...
- R in Action 读书笔记(4)
MindMapper 原文件
- 利用Hexo搭建个人博客-博客初始化篇
上一篇博文 <利用Hexo搭建个人博客-环境搭建篇> 中,我们讲解了利用Hexo搭建个人博客应该要配置哪些环境.相信大家已经迫不及待的想要知道接下来应该要怎么把自己的博客搭起来了,下面,让 ...
- C# 的 Dictionary 寫入前應注意事項
一個已上線.用戶龐大的系統,幾個月來第一次出現這個系統錯誤訊息 : 「已經加入含有相同索引鍵的項目」「已添加了具有相同键的项」An item with the same key has already ...
- SqlServer英文单词全字匹配
环境:Vs2013+Sql Server2012 问题:现在数据库记录如下: Sentence列保存的是英文的句子,我现在想找出所有包含“I”(单词)的句子,如果我用 Sentence like '% ...
- Hibernate增删查改语句
我用的数据库是MySQL,实体类叫Product create table Product ( proId integer not null auto_increment, proName varch ...
- 考勤系统代码分析——主页布局easyui框架
考勤系统主页的布局用的是easyui的Layout控件 Layout:布局容器有5个区域:北.南.东.西和中间.中间区域面板是必须的,边缘的面板都是可选的.每个边缘区域面板都可以通过拖拽其边框改变大小 ...
- 考勤系统——代码分析datagrid
datagrid是easyui的控件,DataGrid以表格形式展示数据,并提供了丰富的选择.排序.分组和编辑数据的功能支持.DataGrid的设计用于缩短开发时间,并且使开发人员不需要具备特定的知识 ...
- Session for SSRS Report of Microsoft Dynamics AX
Session for SSRS Report of Microsoft Dynamics AX 版权声明:本文为博主原创文章,未经博主允许不得转载. Contract •A data contrac ...
- 简易版的TimSort排序算法
欢迎探讨,如有错误敬请指正 如需转载,请注明出处http://www.cnblogs.com/nullzx/ 1. 简易版本TimSort排序算法原理与实现 TimSort排序算法是Python和Ja ...