-
27 Apr 2012 6:27 AM #1
How does override work?
How does override work?
After reading everything I could find on Architect's override in the forums, I am confused on what it can do and how to use it.
It appears that you can override any function as in the example: http://www.sencha.com/forum/showthre...l=1#post745334
But is it possible to override a model's configuration? For instance, I would really like to use 4.1's hasOne feature . But when I try something like the following, it does not work:
Am I setting this up incorrectly or is it impossible to override configurations in models & stores?Code:Ext.define('MyApp.model.override.XXX', { requires: 'MyApp.model.XXX' }, function() { Ext.override(MyApp.model.XXX, { fields: [ { name: 'value', type: 'float' }], associations: { type: 'hasOne', model: 'YYY' } }); });
Note that I am not trying to get Architect's interface to recognize a 4.1 model. I am adding Views dynamically & simply want them to point to a 4.1 model.
-
6 Jun 2012 1:19 PM #2
I agree....
I agree....
I agree, overrides confused me in Architect. How would you go about using them properly?
-
6 Aug 2012 7:59 AM #3
Me too. Im trying to use touch charts and I just can“t figure it out;
-
6 Aug 2012 8:04 PM #4
Try this...
Try this...
Code:Ext.define('MyApp.model.override.XXX',{ override: 'MyApp.model.XXX', initComponent: function() { this.fields = [ // your fields ]; this.associations = [ // your associations ]; this.callParent(arguments); } });
-
7 Aug 2012 3:03 AM #5
Can you drop an example of using touch charts with override please?
-
7 Aug 2012 6:35 AM #6
Never had the chance to use charts
Never had the chance to use charts
I have no examples of doing overrides with charts. Never have had the chance to work with them yet.
-
7 Aug 2012 2:41 PM #7
@angraxs2: I assume you are trying to use the Sencha Touch 2.1 beta, since touch charts don't exist in 2.0.x. I haven't tried it but in general you would create a Container and create an override for the container, then edit the override code to add an 'items' config containing the configuration for your chart. So something like:
@JBlinten: I believe that Models, or at least certain aspects of models, cannot be overridden using the class system's override method because model classes are initialized immediately upon class definition, not on instantiation, so by the time your override code runs the model has already finished being set up.Code:Ext.define('MyApp.view.override.MyContainer1', { override: 'MyApp.view.MyContainer1', config: { items: [{ xtype: 'chart', store: 'myChartStore', // ...etc... }] } });Jason Johnston
@lojjic
Sencha Architect Development Team
-
8 Aug 2012 8:41 AM #8
Thanks for the tip. I will give a try today and will give a feedback for whoever is also tro figure it out.
-
21 Mar 2013 2:10 AM #9
I've try to add to my model a custom field but the following code doesn't work.
Can somebody put an example?
Thank you.
Ext.define('aaaBanking.model.override.DynamicForm', {
override: 'aaaBanking.model.DynamicForm',
fileds: [
{
name: 'listValue',
type: 'listItems'
}
]
});
-
21 Mar 2013 2:13 AM #10


Reply With Quote