-
10 Jan 2013 1:44 AM #1
Unanswered: wrapping all functions beforehand
Unanswered: wrapping all functions beforehand
Hi, everyone,
is there a possibility to wrap all created functions globally,i.e.
put sth like
into app.js?Code:var myMask = new Ext.LoadMask(Ext.ComponentQuery.query('toptabbar')[0].getActiveTab(), { msg:"Bitte warten, Daten werden geladen" }); myMask.show(); Ext.Function.defer(function(){ //every function call },1);
Thank you in advance for your help.
-
10 Jan 2013 6:25 AM #2
Are you saying that you want a single, central object to act as a home for all of your global functions?
-
10 Jan 2013 6:26 AM #3
ideally, I want to wrap a loadMask around any function.
-
10 Jan 2013 7:47 AM #4
Can you give me a rough idea of what kind of functions you're talking about and more information on what you're trying to accomplish?
I ask because most of the Ajax driven components in the ExtJs framework already support a native masking feature.
-
10 Jan 2013 7:55 AM #5
The problem with loading masks ( at least my ones...
) is, that they are displaying fine in FF and Opera, but in Chrome and IE they are shown right before they are hidden (which means, they are not visible to the user - this is a browser related "problem", I think).
So I wanted to wrap my function calls (i.e. the functions in the Controllers) in a deferred function, because that did the trick to display them in Chrome and IE.
-
10 Jan 2013 10:44 AM #6
Is this problem only happening on the initial load of a page/panel? Or does it occur on pre-existing components that are refreshed/reloaded via an Ajax call?
Based on the version of ExtJs you're using, their were several bugs across several point releases which caused problems with load masking.
In particular, I think v4.1.1 still requires me to do a hack/fix to get proper Ajax load masking on a Grid:
Code:Ext.override(Ext.view.AbstractView, { onRender: function() { var me = this; this.callOverridden(); if (me.mask && Ext.isObject(me.store)) { me.setMaskBind(me.store); } } });


Reply With Quote