0

データベースからチェックボックスグループを作成する必要があります。メソッド #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}"]

When、FireBugが言うフォームを示します:

TypeError: undefined をオブジェクトに変換できません

何か案は ?。ありがとう !。

4

1 に答える 1

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}]
于 2013-06-12T00:25:05.763 に答える