2013-06-12 94 views
0

我需要從數據庫填充checkboxgroup。 我有一個方法#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}"]

當,顯示了形式螢火說:

TypeError: can't convert undefined to object

有任何想法嗎 ?。謝謝 !。

回答

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}] 
+0

謝謝!現在工作:) – ramiromd