无线电按钮在ExtJS中具有相同名称的问题。

huangapple go评论53阅读模式
英文:

Radio button issue with same name in ExtJS

问题

这个问题在ExtJS 6.0之前运行正常。在从ExtJS 6.0升级到ExtJS 6.2后,我开始遇到这个问题。

  1. 我在ExtJS中创建了两个表单面板。
  2. 在每个面板上添加单选按钮后,设置相同的名称。
  3. 尽管名称相同,但我期望每个面板都是隔离的,不会相互影响。
  4. 然而,当检查已更改的数据时,由于单选按钮相互影响,存在问题。

我想知道为什么6.0版本和6.2版本的行为不同。
同样的问题在7.6版本中也得到了确认。
您可以在下面的Fiddle链接中检查每个版本。

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

ExtJS 6.0
ExtJS 6.0单选按钮

ExtJS 6.2
ExtJS 6.2单选按钮

我尝试了以下方法。

  1. 我使用了单选按钮的“local”属性,但没有起作用。
  2. 我找不到解决方法,所以我正在使用不同的名称。
英文:

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.

答案1

得分: 1

你可以配置你的单选按钮以允许其他组件共享相同的名称。希望能帮到你

{xtype: 'radiofield', shareableName: true}

英文:

you can configure your radio button to allow the other component to share the same name. hope this helps

{xtype: 'radiofield', shareableName: true}

huangapple
  • 本文由 发表于 2023年5月17日 13:03:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76268717.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定