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 来管理所有添加到 ...
随机推荐
- 我为什么很烦在DB服务器上安装杀毒软件
常见的数据库连接问题无外乎是在数据库服务器本地可以连接SQL Server,但通过其他服务器就不可以连接.但这次我却碰到了相反的情况,在服务器本地无法通过IP/实例名连接,但从其他服务器却可以.而且每 ...
- 我如何介绍 Microservice
这篇文章转自我的 Github blog 一天我司招财猫姐(HR 大人)问我,你给我解释一下 Microservice 是什么吧.故成此文.一切都是从一个创业公司开始的. 故事 最近的创业潮非常火爆, ...
- Python学习路径及练手项目合集
Python学习路径及练手项目合集 https://zhuanlan.zhihu.com/p/23561159
- 解决ora-01652无法通过128(在temp表空间中)扩展temp段的过程
解决ora-01652无法通过128(在temp表空间中)扩展temp段的过程 昨天开发人员跟我说,执行一个sql语句后,大约花了10分钟,好不容易有一个结果,但是报了一个ora-01652错误,查阅 ...
- Sql Server系列:索引设计原则及优化
1. 索引设计原则 索引设计不合理或缺少索引都会对数据库的性能造成障碍,高效的索引对于获得良好的性能非常重要. 设计索引时的一些原则: ◊ 索引并不是越多越好,一个表中如果有大量的索引,不仅占用大量的 ...
- C#设计模式系列:组合模式(Composite)
1.组合模式简介 1.1>.定义 组合模式主要用来处理一类具有“容器特征”的对象——即它们在充当对象的同时,又可以作为容器包含其他多个对象. 1.2>.使用频率 中高 2.组合模式结构图 ...
- 希尔排序及希尔排序java代码
原文链接:http://www.orlion.ga/193/ 由上图可看到希尔排序先约定一个间隔(图中是4),然后对0.4.8这个三个位置的数据进行插入排序,然后向右移一位对位置1.5.9进行插入排序 ...
- 处理UnicodeDecodeError: ‘XXX' codec can't decode bytes in position...的问题
错误信息: UnicodeDecodeError: ‘XXX' codec can't decode bytes in position 2-5: illegal multibyte sequence ...
- Android自用-----WindowManager$BadTokenException: Unable to add window -- token null is not for an application
转自http://www.cnblogs.com/oakpip/archive/2011/04/06/2007310.html 错误产生: private Context mcontext; @Ove ...
- HTTP的RST包与WinHttp延迟关闭TCP连接
一.RST包也常见于断开TCP连接 几个月前用wireshark抓HTTP包发现有的网络通信在结束的时候没有使用四次握手,而是直接使用RST包.如: 在TCP协议中RST表示复位,用来异常的关闭连接 ...