Results 1 to 2 of 2

Thread: Working with toggleGroup

  1. #1
    Sencha User castitas's Avatar
    Join Date
    Sep 2011
    Location
    US
    Posts
    116
    Answers
    3
    Vote Rating
    4
      0  

    Default Unanswered: Working with toggleGroup

    Is there any way to get which button is pressed in a toggle group without iterating over all of them? It's not an object, so I don't think there is...
    word

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Answers
    501
    Vote Rating
    249
      0  

    Default

    Feeling daring?
    You can use the private method getPressed() from the private singleton class: Ext.button.Manager by passing the toggleGroup string to it.

    Feeling less daring and not wanting to use private methods of private classes?
    *Borrowing from getPressed()...

    Code:
    var group = Ext.ComponentQuery.query('[toggleGroup="The-Toggle-Group"]');
    
    Ext.each(group, function (btn) {
        if (btn.pressed === true) { return btn; }
    });
    
    return null;

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
  •