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 来管理所有添加到 ...
随机推荐
- ASP.NET Web API 接口执行时间监控
软件产品常常会出现这样的情况:产品性能因某些无法预料的瓶颈而受到干扰,导致程序的处理效率降低,性能得不到充分的发挥.如何快速有效地找到软件产品的性能瓶颈,则是我们感兴趣的内容之一. 在本文中,我将解释 ...
- Web3DGame之路,Babylonjs 和TypeScript学习笔记(一)
一个开源的Webgl3D引擎,javascript or typescript http://www.babylonjs.com 啥是WebGL WebGL 网页图形库,简称WebGL,是一个JS库, ...
- GUI - GEB UI库
最近基于Winform开发了几款产品,感觉Winform有很大的局限性,其最主要的一点在于:控件是基于Windows窗体的,这就导致每个控件都是重量级控件,对复杂的界面来说,其性能和表现力都欠佳.在实 ...
- [变]C#谜题(1-10)表达式篇
[变]C#谜题(1-10)表达式篇 最近偶然发现了<Java谜题>,很有意思,于是转到C#上研究一下. 本篇是关于表达式的一些内容. 谜题1:奇数性(负数的取模运算) 下面的方法意图确定它 ...
- Azure PowerShell (4) 使用PowerShell管理多个订阅
<Windows Azure Platform 系列文章目录> 笔者手上有两个Azure账户. - Azure Global (windowsazure.com)账户.有两个订阅. - 世 ...
- 微冷的雨之Java中的多线程初理解(一)
在讲解多线程前,我们必须理解什么是多线程?而且很多人都会将进程和线程做对比. 进程和线程 进程:进程是操作系统结构的基础,是一次程序的执行,是一个程序及其数据在处理机上顺序执行时所发生的活动,是程序在 ...
- EF:Oracle.DataAccess.Client.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
报告错误:Oracle.DataAccess.Client.OracleException: ORA-12154: TNS:could not resolve the connect identifi ...
- 《Entity Framework 6 Recipes》中文翻译系列 (25) ------ 第五章 加载实体和导航属性之加载完整的对象图和派生类型上的导航属性
翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 5-5 加载完整的对象图 问题 你有一个包含许多关联实体的模型,你想在一次查询中, ...
- 日志log2
public class LoggerHelper2 { private static ConcurrentQueue<string> CqMsg = null; private stat ...
- java继承、抽象和接口
package zdbExtends;public class Grandparent { public Grandparent(){ System.out ...