extjsradio-buttonradio-group

Radio button issue with same name in ExtJS


This problem worked fine before ExtJS 6.0. I started having this problem after upgrading from ExtJS 6.0 to ExtJS 6.2.

  1. I created two form panels in ExtJS.
  2. After adding radio buttons to each panel, set the same name.
  3. Although the names are the same, I expected each panel to be isolated so they wouldn't affect each other.
  4. However, there is a problem when checking the changed data with dirty because the radio buttons affect each other.

I want to know why the 6.0 and 6.2 versions behave differently. The same problem is confirmed in 7.6. You can check each version in the Fiddle link below.

ExtJS Fiddle : https://fiddle.sencha.com/#view/editor&fiddle/3nn6

ExtJS 6.0 ExtJS 6.0 Radio Button

ExtJS 6.2 ExtJS 6.2 Radio Button

I tried this.

  1. I used the "local" property of the radio button, but it didn't work.
  2. I couldn't find a solution, and I'm using a different name.

Solution

  • It‘s a bug. They want to fix it soon. Here is the workaround (Version 7.8.0)

    Ext.define('EXTJS_30156.form.field.Radio', {
    override: 'Ext.form.field.Radio',
    
    getRawValue: function() {
        var radioGroup = this.up('radiogroup');
    
        return radioGroup && radioGroup.local ? this.checked : this.callParent();
    },
    
    getValue: function() {
        var radioGroup = this.up('radiogroup');
    
        return radioGroup && radioGroup.local ? this.checked : this.callParent();
    }
    
    
    });