1. #1
    Sencha User castitas's Avatar
    Join Date
    Sep 2011
    Location
    US
    Posts
    96
    Vote Rating
    2
    Answers
    2
    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
    2,257
    Vote Rating
    64
    Answers
    169
    slemmon is just really nice slemmon is just really nice slemmon is just really nice slemmon is just really nice slemmon is just really nice

      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