1. #1
    Sencha Premium Member
    Join Date
    Nov 2010
    Posts
    21
    Vote Rating
    1
    JBlinten is on a distinguished road

      0  

    Default 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:

    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' }
            
        });
    });
    Am I setting this up incorrectly or is it impossible to override configurations in models & stores?

    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.

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    London
    Posts
    386
    Vote Rating
    16
    digeridoopoo will become famous soon enough

      0  

    Default I agree....

    I agree....


    I agree, overrides confused me in Architect. How would you go about using them properly?

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    61
    Vote Rating
    0
    angraxs2 is on a distinguished road

      0  

    Default


    Me too. Im trying to use touch charts and I just can´t figure it out;

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      0  

    Default 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);
      }
    });

  5. #5
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    61
    Vote Rating
    0
    angraxs2 is on a distinguished road

      0  

    Default


    Can you drop an example of using touch charts with override please?

  6. #6
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      0  

    Default 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. #7
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    423
    Vote Rating
    15
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    @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:

    Code:
    Ext.define('MyApp.view.override.MyContainer1', {
        override: 'MyApp.view.MyContainer1',
        
        config: {
            items: [{
                xtype: 'chart',
                store: 'myChartStore',
                // ...etc...
            }]
        }    
    });
    @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.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  8. #8
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    61
    Vote Rating
    0
    angraxs2 is on a distinguished road

      0  

    Default


    Thanks for the tip. I will give a try today and will give a feedback for whoever is also tro figure it out.

  9. #9
    Sencha User
    Join Date
    May 2012
    Location
    Romania
    Posts
    37
    Vote Rating
    0
    oana0211 is on a distinguished road

      0  

    Default


    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'
    }
    ]

    });

  10. #10
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    503
    Vote Rating
    47
    tangix has a spectacular aura about tangix has a spectacular aura about tangix has a spectacular aura about

      0  

    Default


    Quote Originally Posted by oana0211 View Post
    I've try to add to my model a custom field but the following code doesn't work.
    If the misspelling of "fields" is in your code, this would explain the problems.
    The overrides are not checked for errors etc.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar