码迷,mamicode.com
首页 > 其他好文 > 详细

ext form

时间:2016-04-06 14:44:33      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

/**
 * 证照编辑
 * 
 * @class CertificationForm
 * @extends Ext.Window
 */
StudentForm = Ext.extend(Ext.Window, {
            formPanel : null,
            constructor : function(a) {
                Ext.applyIf(this, a);
                this.initUI();
                StudentForm.superclass.constructor.call(this, {
                            layout : "fit",
                            id : "StudentFormWin",
                            title : "学生档案",
                            iconCls : "menu-admin-certification-ledger",
                            width : 830,
                            height : 410,
                            border : false,
                            modal : true,
                            plain : true,
                            buttonAlign : "center",
                            buttons : [{
                                        text : "确定",
                                        iconCls : "btn-save",
                                        scope : this,
                                        handler : this.save
                                     },{
                                        text : "取消",
                                        iconCls : "btn-cancel",
                                        scope : this,
                                        handler : function() {
                                            this.close();
                                        }
                                    }],
                                    items : {
                                        xtype : "form",
                                        layout : "column",
                                        padding : 5,
                                        anchor : "100%",
                                        items : [{//1列--表单
                                             columnWidth : .7,
                                             layout : "form",
                                             items : [{//1列行布局
                                                 layout : "column",
                                                 items : [{//1列1行1列布局
                                                    columnWidth : .5,
                                                    layout : "form", 
                                                    items : [{
                                                    xtype:"textfield", 
                                                    fieldLabel : "姓名", 
                                                    anchor : "96%", 
                                                    emptyText : "小明",
                                                    id:"name"  
                                                  }]
                                             },{//1列1行2列布局
                                                 columnWidth : .5,
                                                layout : "form", 
                                                items : [{
                                                xtype:"textfield", 
                                                fieldLabel : "班级", 
                                                anchor : "96%", 
                                                emptyText : "英语A", 
                                                id:"bj"  
                                              }]
                                         }]
                                            },{//1列行布局
                                                layout : "column",
                                             items : [{//1列1行1列布局
                                                columnWidth : .5,
                                                layout : "form", 
                                                items : [{
                                                xtype:"textfield", 
                                                fieldLabel : "年龄", 
                                                anchor : "96%", 
                                                emptyText : "18", 
                                                id:"age"  
                                              }]
                                         },{//1列1行2列布局
                                             columnWidth : .5,
                                            layout : "form", 
                                            items : [{
                                            xtype:"textfield", 
                                            fieldLabel : "住址", 
                                            anchor : "96%", 
                                            emptyText : "长沙", 
                                            id:"dz"  
                                          }]
                                       }]
                                    },{//1列行布局
                                           layout : "column",
                                         items : [{//1列1行1列布局
                                            columnWidth : .5,
                                            layout : "form", 
                                            items : [{
                                            xtype:"textfield", 
                                            fieldLabel : "性别", 
                                            anchor : "96%", 
                                            emptyText : "男", 
                                            id:"sex"  
                                          }]
                                     },{//1列1行2列布局
                                            columnWidth : .5,
                                        layout : "form", 
                                        items : [{
                                        xtype:"textfield", 
                                        fieldLabel : "民族", 
                                        anchor : "96%", 
                                        emptyText : "汉", 
                                        id:"mz"  
                                      }]
                                   }]
                                }]
                                         },{//2列--相片
                                          columnWidth : .3,
                                          layout : "form",
                                          items : [{ 
                                            anchor : "96%", 
                                            html:‘<div><img src="image/mimi.jpg" /></div>‘
                                              }]
                                            }]
                            },
                            keys : {
                                key : Ext.EventObject.ENTER,
                                fn : this.save,
                                scope : this
                            }
                        });
            },

            initUI : function() {
                this.certificationId && this.loadData({
                            url : "/admin/getCertification.do?certificationId=" + this.certificationId,
                            dataName : "certification"
                        });
            },

            // // 保存
            save : function() {
                this.validate()
                        && $submitObject(this.toObject(this.certification), "certification",
                                "/admin/saveCertification.do", function(resp) {
                                    $callback(this, this.certification);
                                }, this);
            }
        });

 

ext form

标签:

原文地址:http://www.cnblogs.com/gpc272/p/5359025.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!