【问题标题】:Populate checkboxgroup填充复选框组
【发布时间】:2013-06-12 08:25:05
【问题描述】:

我需要从 db 中填充一个复选框组。 我有一个方法#populateObrasSociales(anArrayOfChkbox),这个方法的代码是:

populateObrasSociales: function(anArrayOfChkBox){
        var chkGrp = Ext.create('Ext.form.CheckboxGroup',{
            columns: 1,
            vertical: true,
            items: anArrayOfChkBox
        });
}

anArrayOfCheckBox 是:

["{name:IOMA,boxLabel:IOMA,inputValue:1}", "{name:OSPE,boxLabel:OSPE,inputValue:2}"]

当,FireBug 显示表单:

TypeError: can't convert undefined to object

有什么想法吗?谢谢!。

【问题讨论】:

    标签: database extjs checkboxlist populate


    【解决方案1】:

    我猜你的复选框配置对象是字符串这一事实并没有帮助:

    ["{name:IOMA,boxLabel:IOMA,inputValue:1}", "{name:OSPE,boxLabel:OSPE,inputValue:2}"]
    

    没有引号,它们是对象:

    [{name:IOMA,boxLabel:IOMA,inputValue:1}, {name:OSPE,boxLabel:OSPE,inputValue:2}]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-20
      • 2019-04-18
      • 2019-01-07
      • 2011-09-08
      • 2015-02-19
      • 2014-11-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多