Extjs.FormPanel
生活随笔
收集整理的這篇文章主要介紹了
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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VS.NET C#视频教学
- 下一篇: HDU 4634 Swipe Bo(搜索