1. #1
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    33
    Vote Rating
    0
    jackclick is on a distinguished road

      0  

    Default Unanswered: Custom button config

    Unanswered: Custom button config


    I give all of my buttons a custom config property called action.

    Code:
    items: [                            {
    
                                    text: 'Update Case',
                                    action: 'updateCase',
                                    xtype: 'button'
                                },
                                {
                                    text: 'Close Case',
                                    action: 'closeCase',
                                    xtype: 'button'
                                }
                            ]
    Then in my controller I have something like

    Code:
    if (button.action == 'updateCase')
    It works fine in chrome, but when I make a package and test it on the iPhone the action is no longer available and/or lost. I added a Ext.msg.alert before the if statement and printed out button.action and it was empty.

    I had to add a workaround:

    Code:
    button.getInitialConfig('action')
    which works for now but it would be a lot smoother if I could use just button.action.

    Sidenote:

    I have tried button.getAction() and that does not work.

    Thanks!
    -->

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    Answers
    102
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    have you tried button.config.action? To be honest, this type of ad-hoc stuff is discouraged. The config system helps define an PI. If you need special functionality, consider extending.
    -->

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    33
    Vote Rating
    0
    jackclick is on a distinguished road

      0  

    Default


    Thanks for the response.

    It looks like button.config.action works.

    Thanks!
    -->

Thread Participants: 1