1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    16
    Vote Rating
    0
    stephensaw is on a distinguished road

      0  

    Default Updating properties object

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,599
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    try

    Code:
    this.getAnimationType().direction = 'right';
    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.

Tags for this Thread