Results 1 to 3 of 3

Thread: Custom button config

  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2011
    Posts
    33
    Vote Rating
    0
      0  

    Default 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 User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    86
      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
      0  

    Default

    Thanks for the response.

    It looks like button.config.action works.

    Thanks!

Posting Permissions

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