我想将所有选中的项目放在一个属于formpanel的复选框组中.最终,它们将以字符串,逗号分隔的值格式保存回数据库.
感谢您提供的任何指导或帮助.
这是我对小组的定义:
new Ext.form.CheckBoxGroup({
id: 'newId',
fieldLabel: 'Group A',
name: 'broker',
allowBlank: false,
columns: 1,
items: [{
BoxLabel: 'All',
name: 'all',
id: 'null'
},
{
BoxLabel: 'FS',
name: 'fs',
id: '1'
},
{
BoxLabel: 'Royal A',
name: 'ra',
id: '2'
},
{
BoxLabel: 'Point',
name: 'sp',
id: '6'
}]
})
解决方法:
使用CheckBoxGroup的getValue()方法.从API docs开始:
getValue():
Gets an array of the selected
Ext.form.CheckBox in the group.Returns: An array of the selected checkBoxes.
然后,您可以在返回的Array上调用join(“,”)以获取逗号分隔的列表.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。