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

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

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。