elAlign:fieldlabel 的排列位置,默认 为 quotleftquot,其他两个枚举 值 是quotcenterquotquotrightquot2.labelWidth:fieldlabel 的占位宽3.method:quotgetquot或quotpostquot4.url:quot提交的地址quot5.submit:提交函数 //稍后我们 一起详 细 分析因为 内容太多,我们 先看一个例子。
1.FormPanel 的 fieldset 应 用//把前面代码 重写 items 属性items: xtype:fieldset title: 个人信息 collapsible: true autoHeight:true width:330 defaults: width: 150 defaultType: textfield items : fieldLabel: 爱 好 name: hobby value: www.cnblogs.com xtype:quotcomboquot name: sex store:quot男quotquot女quotquot保密quot//数据源为 一数组 fieldLabel:quot性别 quot emptyText:请 选 择 性别 . 这 里的 combox 组 件只是简 单 的演示,具体还 是要深入了解,我们 会在以后的内容中详 细 探讨 。
2.关 于 xtype 的类 型,在 extjs 的 form 表单(其他的请 参考 api)中已经 定义 的有:Form components---------------------------------------form Ext.FormPanelcheckbox Ext.form.Checkboxcombo Ext.form.ComboBoxdatefield Ext.form.DateFieldfield Ext.form.Fieldfieldset Ext.form.FieldSethidden Ext.form.Hiddenhtmleditor Ext.form.HtmlEditorlabel Ext.form.Labelnumberfield Ext.form.NumberFieldradio Ext.form.Radiotextarea Ext.form.TextAreatextfield Ext.form.TextFieldtimefield Ext.form.TimeFieldtrigger Ext.form.TriggerField ExtJs 学习 系列5--Ext.FormPanel 之第二式之前谈 到了 FormPanel 中的 fieldset 和 ComboBox下边 继 续 。
.可选 的 fieldset 实 例 主要知识 点://因为 觉 得这 个参数特别 ,特举 一例以说 明1.checkboxToggle:true//true 则 呈现 一个带 checkbox 的 fieldset,选 中则 展开 ,否则 相反,默认 为 false2.checkboxName:string//当上面为 true 时 ,作为 checkbox 的 name,方便表单操作这 里我把 js 核心代码 贴 出来html 代码 与上一篇中完全相同,不列出://在上一节 的基础 代码 的 items 里面添加如下配置xtype:quotfieldsetquotcheckboxToggle:true//关 键 参数,其他和以前的一样checkboxName:quotdfdfquottitle:quot选 填信息quotdefaultType:textfieldwidth:330autoHeight:true//使自适应 展开 排版items: fieldLabel:quotUserNamequot name:quotuserquot anchor:quot95quot//330px-labelWidth 剩下的宽 度的 95,留下 5作为 后面提到的验 证 错 误 提示 fieldLabel:quotPassWordquot inputType:quotpasswordquot//密码 文本 name:quotpassquot anchor:quot95quot .
上一篇:
韩顺平—linux_笔记
下一篇:
人生哲理:独赏