码迷,mamicode.com
首页 > 编程语言 > 详细

【JAVA】WEB开发实际任务——记录

时间:2015-08-25 13:52:46      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

一 Ext namespace 解析

  对于java中的包,我们都认为主要是为了类名重复而引入的一种管理类的方法。同样,因为js定义的类太多,难免会定义重复的类名。特别是在今天这个需要共同协作完成项目的世界里。Ext.namespace正是为此而生。 Ext.namespace(‘com.company‘); 就是定义了一个com.company的包。 com.company.ClassA = function(){};就是定义了com.company包下面的一个Class。你一定会问,既然定义了包,为什么还要写包的前缀com.company?我直接写com.company.ClassA = function(){}不行吗?对,一开始我也有这样的疑惑,com.company.ClassA不就是一个变量名称吗?哪儿来的包。后来经实践,javascript的变量名称是不准包括‘.‘的。因此,直接写com.company.ClassA = function(){};在语法上是不正确的。

 

二 Ext form表单设计

var form = new Ext.form.FormPanel({  
    frame : true,  
    height : 550,  
    labelAlign : ‘left‘,  
    labelWidth : 110,  
    defaultType : ‘textfield‘,  
    defaults : {  
        width : 110  
            allowBlank : false  
    },  
    items : {  
        layout : ‘column‘,//定义为列模式  
        height : 100,  
        items : [{  
            columnWidth : .33, //显示为第一列的宽度33%  
            layout : ‘form‘,  
            items : [{  
                xtype : ‘textfield‘,//显示为输入框  
                fieldLabel : ‘姓名,//标签名称   
                   labelStyle:‘color:red‘,//标题的样式  
                   minLength : 6,  
           minLengthText : "长度不能小于6个字符",  
           maxLength : 20,  
           maxLengthText : "长度超过了20个字符",  
                name : ‘first‘,//  
                style:‘color:white‘,//编辑框的样式  
                allowBlank:false,//不允许为空  
                blankText:‘密码不能为空‘//不允许为空给的提示  
                   regex : /[\u4e00-\u9fa5]/, //正则表达式在/...../之间.  
                regexText:"只能输入中文!",//正则表达式错误提示  
                anchor : ‘90%‘  
            }, {  
                xtype : ‘textfield‘,  
                fieldLabel : 生份证号,  
                name : ‘company‘,  
                anchor : ‘90%‘  
            }, {  
                xtype : ‘textfield‘,  
                fieldLabel : ‘有效期截止日期‘,  
                name : ‘company‘,  
                anchor : ‘90%‘  
            }]  
        }, {  
            columnWidth : .33,  
            layout : ‘form‘,  
            items : [{  
                xtype : ‘textfield‘,  
                fieldLabel : ‘入库合格证号‘,  
                name : ‘last‘,  
                anchor : ‘95%‘  
            }, {  
                xtype : ‘textfield‘,  
                fieldLabel : ‘入库合格证号‘,  
                name : ‘email‘,  
                vtype : ‘email‘,  
                anchor : ‘95%‘  
            }, {  
                xtype : ‘textfield‘,  
                fieldLabel : ‘航天标示码‘,  
                name : ‘A‘,  
                anchor : ‘95%‘  
            }]  
        }, {  
            columnWidth : .33,  
            layout : ‘form‘,  
            items : [{  
                xtype : ‘textfield‘,  
                fieldLabel : ‘入库合格证号‘,  
                name : ‘last‘,  
                anchor : ‘95%‘  
            }, {  
                xtype : ‘textfield‘,  
                fieldLabel : ‘入库合格证号‘,  
                name : ‘email‘,  
                vtype : ‘email‘,  
                anchor : ‘95%‘  
            }, {  
                xtype : ‘textfield‘,  
                fieldLabel : ‘复验合格证工程型号‘,  
                name : ‘s‘,  
                anchor : ‘95%‘  
            }]  
        }]  
    },  
    buttons : [{  
        text : ‘执行过滤条件‘,  
        handler : function() {  
            if (!form.getForm().isValid()) {  
                return;  
            };  
            store.baseParams = {  
                xmlFile : getQueryStringValue(‘xmlFile‘),  
                condictions :  getCondictionValues()  
            };  
            store.reload();  
            form.getForm().reset();  
        }  
    }, {  
        text : ‘重置‘,  
        handler : function() {  
            form.getForm().reset();  
        }  
    }]  
});  

 

【JAVA】WEB开发实际任务——记录

标签:

原文地址:http://www.cnblogs.com/lijieqiong/p/4756722.html

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