Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: RadioGroups broken in 4.0.2

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-4012 in a recent build.
  1. #11
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Bangalore
    Posts
    79
    Vote Rating
    1
      0  

    Default

    I dont see its fixed in 4.2 as well.

    i am using extjs 4.2 and having same problem.

  2. #12
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Bangalore
    Posts
    79
    Vote Rating
    1
      0  

    Default

    I am new to extjs ,

    can you tell where to place the overridden code ?


    Quote Originally Posted by skirtle View Post
    To clarify, the issue is that for any 2 radio buttons with the same name it is only possible to select one of them, no matter where they appear in the page. In contrast, HTML allows forms to be used to partition radio buttons with the same name.

    One might expect either a radiogroup or a form panel to perform the role of partitioner in ExtJS but they do not.

    I have written an override to fix this problem, tested in 4.0.2 and 4.0.5. It follows the HTML convention of separating radio buttons by form but can easily be modified to use radiogroups.

    Code:
    Ext.apply(Ext.form.field.Radio.prototype, {
        onChange: function(newVal, oldVal) {
            var me = this;
            Ext.form.field.Radio.superclass.onChange.apply(this, arguments);
    
            if (newVal) {
                var form = this.up('form');
    
                this.getManager().getByName(me.name).each(function(item){
                    if (item !== me && form === item.up('form')) {
                        item.setValue(false);
                    }
                }, me);
            }
        }
    });

  3. #13
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Vote Rating
    391
      0  

    Default

    @rupamkhaitan. This has been fixed since 4.1. The influence of radio buttons should now be restricted to their surrounding Ext.form.Panel.

  4. #14
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Bangalore
    Posts
    79
    Vote Rating
    1
      0  

    Default

    But I am still facing this issue in 4.2?

    I have a component which is called 4 times inside a page, and when i click on radio item of componen1, it basically goes an uncheck the radios of other component as well.

  5. #15
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Bangalore
    Posts
    79
    Vote Rating
    1
      0  

    Default

    i got the problem, i was attaching listener to same component id, so it was firing multiple times,

    I have now fixed it by attaching listener to individual component with their own ID

  6. #16
    Sencha User
    Join Date
    Oct 2015
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Sorry to bump an old thread, but as others suggested, I believe this bug still exists in 5.1.0. I am easily able to reproduce it. Furthermore, I believe if you provide the override that @skirtle suggested. It will make radio buttons which are *part of a form* behave incorrectly (so it fixes radio buttons NOT in a form but breaks radio buttons IN a form). That is because me.getManager().getByName() takes 2 arguments: the name of the radio button and the formId. Can someone please confirm this?

  7. #17
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    10,385
    Vote Rating
    264
      0  

    Default

    I placed the original test case into this Fiddle:
    https://fiddle.sencha.com/#fiddle/17ef

    I'm not able to reproduce the issue. Do you see the issue in this test case? If so, with which browser are you seeing it? If not, can you please post a test case which reproduces the issue in 5.1.0?
    https://fiddle.sencha.com/#home

Page 2 of 2 FirstFirst 12

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
  •