-
2 Sep 2011 5:38 AM #1
What functions can be overriden and what cannot?
What functions can be overriden and what cannot?
As part of another problem, I've come across another issue. Effectively, I'm trying to override the LoadMask.
In order to help this discussion, here's an excerpt of the Ext.LoadMask class:
Notice how hide is calling the "private" method onLoad. Now here is my override:Code:Ext.define('Ext.LoadMask', { // private onLoad : function() { var me = this; me.loading = false; me.el.unmask(); me.fireEvent('hide', me, me.el, me.store); }, /** * Hide this LoadMask. */ hide: function() { this.onLoad(); }, });
The result is that 'onLoad executed' while 'hide executed' doesn't get shown in firebug's console window. Hence, the first question is why is this happening? The next question is what can I override and what can't I override?Code:Ext.override(Ext.LoadMask, { hide: function () { this.callOverridden(); console.log('hide executed'); } , onLoad: function () { this.callOverridden(); console.log('onLoad executed'); } });
-
2 Sep 2011 5:45 AM #2
Ah stupid question. Basically, it's to do with the fact that hide is never called in code while onLoad is.
However, another question that arises from here is how is this onLoad getting called?
-
2 Sep 2011 8:01 AM #3Product Architect
Altus Ltd.
-
2 Sep 2011 10:09 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Ext.LoadMask adds listeners to the load and exception events on the store. Also, if the LoadMask is disabled while loading, it will call onLoad (no listener).
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
5 Sep 2011 12:32 AM #5
Thank you Mitchell and Westy. You've certainly answered my question.


Reply With Quote