Results 1 to 6 of 6

Thread: 'ref' buttons by classname (in a controller)

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    139

    Default 'ref' buttons by classname (in a controller)

    Hi

    I have two logout buttons (each on a different panels), for which I want to do something when they're tapped. I have added a class value of 'logout' to both of them and the following controller setup:

    Code:
           .....
           ref: {
                 logoutButtons: 'button[class~="logout"]' // should match both buttons
           },
           control: {
                logoutButtons: {
                      tap: 'onLogout'
                }
          }
          ....
    Well, this doesn't work, any suggestions how to fix this ?

    Thanks
    Luca

  2. #2

    Default

    you can do below
    Code:
            refs: {
                logoutButton:{
                    selector: '[cls="logout"]'
                }
            },
           control: {
                logoutButton:{
                        tap: 'onLogoutTap'
                }
           }

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Posts
    139

    Default

    check, it works now! Thanks a lot!!

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Location
    Vancouver, Canada
    Posts
    31

    Default

    Worked for me in 2.2.1; now broken in 2.4. I switched to creating a button with its own xtype.

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Posts
    36

    Default

    They've changed the functionality of searching by cls selectors in 2.4. It seems that it now searches for the full cls string which invariably also adds a few x- classes from the framework. 2.4.1 will apparently contain a fix for this: http://www.sencha.com/forum/showthre...-Refs-by-Class

  6. #6
    Sencha User
    Join Date
    Oct 2014
    Posts
    2

    Default

    you can do belowCode: refs: { logoutButton:{ selector: '[cls="logout"]' } }, control: { logoutButton:{ tap: 'onLogoutTap' } }thank you I did not succeed

Posting Permissions

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