When ever app does ajax request i want to add load mask

谁说我不能喝 提交于 2019-12-06 13:01:46

To show load mask you can use:

Ext.Viewport.mask({ xtype: 'loadmask' });

And hide the load mask inside the success function of your Ajax request:

Ext.Viewport.unmask();
Gayathri Mohan

It is very easy Try these

Ext.Ajax.request({
    method:'GET',
    contentType:'application/json; charset=utf-8',
    dataType:'json',
    url:'http://..................Login',
    disableCaching: false,
    withCredentials: true,
    useDefaultXhrHeader: false,
    callbackKey: 'callback',

    params: {
        xyz:.......                                              
      },
    success:function(response){
        console.log(response);
        var res = response.responseText;    
        var jsonarr = Ext.decode(response.responseText);
        console.log(jsonarr);
        var myres = jsonarr[0].Result;
        console.log(myres);
        Ext.Viewport.setMasked(false);  //hide the mask  loaded ...
       Ext.Viewport.setActiveItem({xtype:'dom_flightlist'}); 
   }//end of success fn

}); //end of AJAX Request

After The Success Function Add the Load Mask..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!