PDA

View Full Version : checkboxgroup + EXTDirect



clemence
8 Jun 2010, 12:39 AM
I try to create a list of checkboxes which are filled dynamicaly by ExtDirect. I can see items in the dom but items are not displayed. What can i do?

Example:



var checkGroup = {
xtype: 'fieldset',
title: 'Group',
autoHeight: true,
layout: 'form',
items: [{
xtype: 'checkboxgroup',
fieldLabel: '',
id:'idcheck'
,items: [{boxLabel: 'test', name: 'cb-auto-2'}]
}]
};

var myStore = new Ext.data.DirectStore({
autoLoad: true,
directFn: MyNamespace.MyPHPClass.getListOfCheckbox,
paramsAsHash: false,
idProperty: 'id',
listeners: {
load: function(s, records){
var columns = Ext.getCmp('idcheck').items;
columns.clear();
i=0;
Ext.each(records, function(rec)
{
columns.add({boxLabel: rec.data.Libelle, name: 'mycheckname' + rec.data.id});
//columns.doLayout(); //doesnt work
i++;
}

);

}},
fields :
[{
name : 'id',
type : 'int',
mapping : 'id'
},{
name : 'Libelle',
type : 'string',
mapping : 'Libelle'
}]
});