1. #1
    Sencha User castitas's Avatar
    Join Date
    Sep 2011
    Location
    US
    Posts
    116
    Vote Rating
    3
    Answers
    3
    castitas is on a distinguished road

      0  

    Default Unanswered: Working with toggleGroup

    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,062
    Vote Rating
    215
    Answers
    486
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      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;

Thread Participants: 1

Tags for this Thread