如何在extjs中加载无线电组的数据,以便检查正确的无线电?
在extjs radio/checkbox example page上,您将找到类似这样的代码
{
xtype: 'radiogroup',
fieldLabel: 'Auto Layout',
items: [
{boxLabel: 'Item 1', name: 'rb-auto', inputValue: 1},
{boxLabel: 'Item 2', name: 'rb-auto', inputValue: 2, checked: true},
{boxLabel: 'Item 3', name: 'rb-auto', inputValue: 3},
{boxLabel: 'Item 4', name: 'rb-auto', inputValue: 4},
{boxLabel: 'Item 5', name: 'rb-auto', inputValue: 5}
]
}
我希望做一个像{‘rb-auto’:3,…}这样的带有json的form.load()会将项目3标记为已选中.这行不通.
您怎么能达到这种效果?
答:(Zach关于extjs 3.1是正确的)我的期望是正确的,但仅因为extjs 3.1是最近发布的.同样,您需要在单个广播项目上都将名称设置为组本身:
{
xtype: 'radiogroup',
fieldLabel: 'Auto Layout',
name: 'rb-auto',
items: [
{boxLabel: 'Item 1', name: 'rb-auto', inputValue: 1},
{boxLabel: 'Item 2', name: 'rb-auto', inputValue: 2, checked: true},
{boxLabel: 'Item 3', name: 'rb-auto', inputValue: 3},
{boxLabel: 'Item 4', name: 'rb-auto', inputValue: 4},
{boxLabel: 'Item 5', name: 'rb-auto', inputValue: 5}
]
}
解决方法:
这是适用于extjs 3.0的解决方案:
http://www.extjs.com/forum/showthread.php?t=39161
对于3.1,它不起作用.
原文地址:https://codeday.me/bug/20191210/2101160.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。