[Solved] Formpanel, JsonReader and databinding
I have tried to get the databinding feature to work between the FormPanel and the Jsonreader - without luck and I have absolutely no idea why this does not work..
When I Press the load button the request is getting fired and the result is returned as expected from the service - but the formfields does not get populated???
FormPanel definition: (Some config options has been omitted..)
productForm = new Ext.FormPanel({
defaultType: 'textfield',
waitMsgTarget: true,
success: 'success',
reader: new Ext.data.JsonReader(
{
root: 'GetProductResult',
fields: ['Id','Name', 'Currency']
}
),
items: [{
fieldLabel: 'Product Name',
name: 'Name'
},{
fieldLabel: 'Currency',
name: 'Currency'
}]
});
productForm.addButton('Load', function(){
productForm.getForm().load({url:'service1.svc/GetProduct', method: 'Get', waitMsg:'Loading..',success:successHandler});
});
JSON returned from the server
{"GetProductResult":{"data":{"Currency":"£","Name":"SomeName","success":true}}
Works like a charm !!!
Regards Morten
And then the response should be
{ success: true, data: {Currency: '£', "Name" :"SomeName"}}
#If you have any other info about this subject , Please add it free.# |





