-
19 Jul 2012 12:50 AM #1
Unanswered: Ext define override
Unanswered: Ext define override
When I override a class for example the Spinnerfield I insert this
and I put the functions that I want override, for example applyValue, but inside this method I putCode:Ext.define('my.Spinner', { Ext.define('iBone.field.Spinner', { override: 'Ext.field.Spinner', ... })and it go to the function applyValue of the Ext.field.Spinner and then to the applyValue of the Ext.field.Number, when I want that it go directly to the second option. Because it's supposed I'm overriding this fucntion and the same in the Ext.field.Spinner would cease to exist.Code:this.callParent([value])
Am I doing something wrong??
Sorry for my English, thanks
-
21 Jul 2012 12:07 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
You can call the superclass of whatever component via
Code:applyValue : function(newValue, oldValue) { return Ext.field.Number.superclass.applyValue.call(this, newValue, oldValue); }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.
-
21 Jul 2012 10:38 PM #3
Thanks for the reply, I'll try it.
But it's supposed that the method callParent() do the proper function when it's called from a overwritten class or it's a bug and it would go to the superclass of the class overwritten and don't to the parent function of the overwritten class??
Thanks again.
-
22 Jul 2012 9:05 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
You may be needing callOverridden and not callParent, callOverridden !== callParent
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.
-
22 Jul 2012 10:46 PM #5
I tried it with callOverridden and callParent from getValue of a class that overrides Ext.field.Number and two functions go to the same place: getValue function of class Ext.field.Number.
I guess I'll use My.field.Number.superclass.getValue.call(this).
Thanks
-
27 Sep 2012 1:41 PM #6
how do you know when to use calloverridden, and callparent?


Reply With Quote