Results 1 to 2 of 2

Thread: Updating properties object

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
      0  

    Default Updating properties object

    Hi,

    I'm currently learning to create my plugin, and I've came across a question, let's say my plugin code:

    PHP Code:
    Ext.define('Ext.plugin.MyPlugin', {   
            
    extend'Ext.Component',    
            
    xtype'plugin-myplugin',
            
    config: {
                
    speed12,
                
    animationType: {
                    
    direction'left',
                    
    type'flip'
                
    }
            },
            
    init: function() { },
            
    someFunction: function() { }
    }); 
    I understand that in the functions, I can access the 'speed' properties by using this.getSpeed(), or setter as in this.setSpeed(123), but how to I update the direction for the animationType property?

    I've try to do this.setAnimationType({direction: 'right'}) , then when I do this.getAnimationType(), it return me only the object with direction: 'right'. If I do Ext.apply(this.getAnimationType(), {direction: 'right'}), it will return me Ext.Object.classify.objectClass with the following properties (using console.log to observe in Google Chrome's developer tools)

    PHP Code:
    direction'right',
        
    __proto__Object
           direction
    'left'
           
    type'flip'
           
    __proto__Object 
    May I know what is the proper way of updating the value for the properties object?

    Thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    try

    Code:
    this.getAnimationType().direction = 'right';
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •