英文:
Radio button issue with same name in ExtJS
问题
这个问题在ExtJS 6.0之前运行正常。在从ExtJS 6.0升级到ExtJS 6.2后,我开始遇到这个问题。
- 我在ExtJS中创建了两个表单面板。
- 在每个面板上添加单选按钮后,设置相同的名称。
- 尽管名称相同,但我期望每个面板都是隔离的,不会相互影响。
- 然而,当检查已更改的数据时,由于单选按钮相互影响,存在问题。
我想知道为什么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单选按钮
我尝试了以下方法。
- 我使用了单选按钮的“local”属性,但没有起作用。
- 我找不到解决方法,所以我正在使用不同的名称。
英文:
This problem worked fine before ExtJS 6.0.
I started having this problem after upgrading from ExtJS 6.0 to ExtJS 6.2.
- I created two form panels in ExtJS.
- After adding radio buttons to each panel, set the same name.
- Although the names are the same, I expected each panel to be isolated so they wouldn't affect each other.
- 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.
- I used the "local" property of the radio button, but it didn't work.
- 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}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论