-
20 Feb 2012 1:53 PM #1
Answered: Activity spinner during loading?
Answered: Activity spinner during loading?
Is there a way, while the app actually is displaying the Default loading png in the background, for an app to also show the activity spinner while that is happening, so there's at least something happening beyond a static screen? (Yes, another newbie question.)
-
Best Answer Posted by ratmat2000
I had no luck with the suggestion above or the docs for that matter. The above will only create a blank mask over the screen but will not show a spinner. I was able to show a mask and a spinner every time I make an ajax call by adding this to my app.js launch function:
You could repurpose this code to show the mask and spinner whenever you like using the Ext.getCmp('ajaxMask').show(); and Ext.getCmp('ajaxMask').hide();Code:launch: function() { Ext.Viewport.add({ xtype: 'loadmask', id: 'ajaxMask', message: 'Loading...', indicator: true, hidden: true, }); Ext.Ajax.on('beforerequest', function() { Ext.getCmp('ajaxMask').show(); }, this); Ext.Ajax.on('requestcomplete', function() { Ext.getCmp('ajaxMask').hide(); }, this); Ext.Ajax.on('requestexception', function() { Ext.getCmp('ajaxMask').hide(); }, this); }
-
20 Feb 2012 4:47 PM #2
add a
in your component's config, show/hide via setMasked(true/false)PHP Code:masked: {
xtype: "loadmask"
}
-
20 Feb 2012 7:22 PM #3
I had no luck with the suggestion above or the docs for that matter. The above will only create a blank mask over the screen but will not show a spinner. I was able to show a mask and a spinner every time I make an ajax call by adding this to my app.js launch function:
You could repurpose this code to show the mask and spinner whenever you like using the Ext.getCmp('ajaxMask').show(); and Ext.getCmp('ajaxMask').hide();Code:launch: function() { Ext.Viewport.add({ xtype: 'loadmask', id: 'ajaxMask', message: 'Loading...', indicator: true, hidden: true, }); Ext.Ajax.on('beforerequest', function() { Ext.getCmp('ajaxMask').show(); }, this); Ext.Ajax.on('requestcomplete', function() { Ext.getCmp('ajaxMask').hide(); }, this); Ext.Ajax.on('requestexception', function() { Ext.getCmp('ajaxMask').hide(); }, this); }
-
19 May 2012 8:29 PM #4
Just to add that the solution provided in this thread worked very well, thank you!
-
29 Jun 2012 12:03 PM #5
Ext.getCmp('ajaxMask').show() only shows the loadmask after the data is processed. The show event fires for the loadmask but it doesn't actually display...any ideas?
I posted this as another question with example/picture here: http://www.sencha.com/forum/showthre...297#post846297


Reply With Quote