码迷,mamicode.com
首页 > Web开发 > 详细

2014年12月20日00:33:14-遮罩+进度条-extjs form.isvalid

时间:2014-12-20 02:10:06      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

1、Extjs : 遮罩+进度条

2、Extjs: extjs form.isvalid

http://stackoverflow.com/questions/19354433/extjs-form-isvalid-is-false-but-how-to-know-why-the-form-is-invalid

EXT API:

http://docs.sencha.com/extjs/3.4.0/

http://dev.sencha.com/deploy/ext-3.x/docs/

http://extjs.cachefly.net/ext-3.1.1/docs/

http://extjs.cachefly.net/ext-3.4.0/docs/

EXT CDN HOME:

http://extjs.cachefly.net/ext-3.1.1/

-----------------------------

http://why100000.com/_others/extjs3.0/index.html

 

进度条+遮罩没找到,但下面这个也可用。

技术分享
Ext.onReady(function(){
    var loadMarsk = new Ext.LoadMask(Ext.getBody(),{
        msg : ‘正在处理,请稍后......‘,
        removeMask: true //完成后删除
    });
    loadMarsk.show();
    //loadMarsk.hide();
});
View Code

 

接了一个页面非常复杂的活,验证把人搞死,而且,有地方没有通过extjs自带的验证,没法提交,还不要定位,悲剧啊。还好,下面这个+firebug可以帮助定位下。

技术分享
Ext.onReady(function(){
    var simple = new Ext.FormPanel({
        id: ‘id_formpanel‘,
        labelWidth: 75, // label settings here cascade unless overridden
        url:‘save-form.php‘,
        frame:true,
        title: ‘Simple Form‘,
        bodyStyle:‘padding:5px 5px 0‘,
        width: 350,
        defaults: {width: 230},
        defaultType: ‘textfield‘,

        items: [{
                fieldLabel: ‘First Name‘,
                name: ‘first‘,
                allowBlank:false
            },{
                fieldLabel: ‘Last Name‘,
                name: ‘last‘
            },{
                fieldLabel: ‘Company‘,
                name: ‘company‘
            }, {
                fieldLabel: ‘Email‘,
                name: ‘email‘,
                vtype:‘email‘
            }, new Ext.form.TimeField({
                fieldLabel: ‘Time‘,
                name: ‘time‘,
                minValue: ‘8:00am‘,
                maxValue: ‘6:00pm‘
            })
        ],

        buttons: [{
            text: ‘Save‘,
            handler: function(){
                var formpanel = Ext.getCmp("id_formpanel");
                var form = formpanel.getForm();
                if(!form.isValid()){
                    //console.log( form );
                    var formItems = form.items.items;
                    Ext.each(formItems, function(ia,i,all){
                        //console.log( ia.isValid() );
                        if(!ia.isValid()){
                            console.log( ia.name );
                            console.log( ia );
                        }
                    });
                    return;
                }
            }
        },{
            text: ‘Cancel‘
        }]
    });

    simple.render(document.body);
});
View Code

 

2014年12月20日00:33:14-遮罩+进度条-extjs form.isvalid

标签:

原文地址:http://www.cnblogs.com/juedui0769/p/4174980.html

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