PDA

View Full Version : Ext 3.2 - Cant load checkboxes into checkboxgroup from URL



tigoes
11 Feb 2011, 7:16 AM
Hello,

Am truing to load checkboxes from server side returned JSON data. Am certanly doing something wrong....

Here is (a part of) my FormPannel config:


var config = {
defaultType: 'textarea',
defaults: { anchor: '-24' },
monitorValid: true,
waitTitle: 'Veuillez patienter',
//buttonAlign:'right',
items: [{
xtype: 'checkboxgroup',
fieldLabel: 'Materiel',
name: 'materials'
}, {
name: 'description',
fieldLabel: 'Description',
blankText: 'Ce champ est obligatoire',
allowBlank: false
}],
buttons: [{
text: 'Save',
scope: this,
handler: this.onSaveClick
}]
}; // eo config object


I have some other fields but i decided to detete them in this example to make it shorter. Other fields, textfield, combobox..., are working fine, they get their value from the JSON.

Here is the server response:


{"success":true,"data":{"description":"ezertzertz","materials":[{"inputValue":2,"fieldLabel":"Magnétoscope","name":"material","xtype":"checkbox"},{"inputValue":3,"fieldLabel":"Beamer","name":"material","xtype":"checkbox"},{"inputValue":4,"fieldLabel":"Sonorisation","name":"material","xtype":"checkbox"}]}}

I would like those checkboxes to apear inside of my checkboxgroup. I need them to get loaded in a dynamic way from a database.

In this example the "description" works fine but checkbox groupe is empty.

Any suggestion?

Thanks in advance

tigoes
13 Feb 2011, 11:43 PM
Can somebody help me?