Я хочу создать список динамических флажков в всплывающем окне extjs, получая результат из базы данных, но флажки не отображаются во всплывающем окне. Пожалуйста, помогите найти ошибку. Вот мой код:Как создать динамический флажок в extjs 3.4
var checkboxes = [];
var listStore = new Ext.data.JsonStore({
url:'abc.jsp?action=getList',
baseParams: { parent: 123 },
idProperty: 'name',
fields: ['id','name'],
listeners: {
load: function(records) {
for(var i = 0; i < records.length; i++) {
checkboxes.push({
inputValue: records[i].data.id,
boxLabel: records[i].data.name
});
}
} }
});
myCheckboxGroup = new Ext.form.CheckboxGroup({
id: 'chk1',
xtype: 'checkboxgroup',
border: true,
columns: 1,
vertical: true,
items: checkboxes,
});
passenger=new Ext.FormPanel({
bodyPadding: 10,
width: 300,
xtype : 'fieldset',
title : "Systems",
collapsed:false,
checkboxToggle: true,
anchor : '100%',
defaultType: 'checkbox',
layout: 'anchor',
id:'passengerForm',
defaults: {
anchor: '100%',
hideEmptyLabel: false
},
items:myCheckboxGroup,
buttons: [{
text: 'Ok',
handler: function(){
window.close();
}
},{
text: 'Cancel',
handler: function(){
window.close();
}
}
]
});
var window=new Ext.Window({
title: 'Passenger List',
closable: true,
id:"passenger-window",
//modal:true,
width: 295,
//autoHeight: true,
height:100,
items:[passenger]
}).show();
listStore.load();
passenger.items.add(myCheckboxGroup);
passenger.doLayout();
Заранее благодарен!