PDA

View Full Version : declare reader in FormPanel



imatechnologies
26 Aug 2010, 7:00 AM
Hi all,

I'm noob with Designer.
How can we declare a reader in a FormPanel with the Designer ?

Can we create the same Form like in the exemple : xml-form.js ?

Like this kind of code :

fs = new Ext.FormPanel({

frame: true,
title:'XML Form',
labelAlign: 'right',
labelWidth: 85,
width:340,
waitMsgTarget: true,
// configure how to read the XML Data
reader : new Ext.data.XmlReader({

record : 'contact',
success: '@success'
}, [
{name: 'first', mapping:'name/first'}, // custom mapping
{name: 'last', mapping:'name/last'},
'company', 'email', 'state',
{name: 'dob', type:'date', dateFormat:'m/d/Y'} // custom data types
]),
// reusable eror reader class defined at the end of this file
errorReader: new Ext.form.XmlErrorReader(),

items: [

new Ext.form.FieldSet({
title: 'Contact Information',
autoHeight: true,
defaultType: 'textfield',
items: [{

fieldLabel: 'First Name',
emptyText: 'First Name',
name: 'first',
...

I don't find reader property in the FormPanel in Designer
Must I modify my "file" .ui.js to add the reader ?

Thanks for any Reply

Best Regards

Fab

jarrednicholls
30 Aug 2010, 7:10 AM
Hi Fab,

At this time you cannot define a DataReader for your FormPanel nor your Stores. You can manually add the reader in your exported ".js" class file. Note: do not edit the .ui.js file, because it will be overwritten on every project export...the ".js" file is your implementation file, and it is not overwritten when it already exists on the file system.

Thanks,
Jarred

imatechnologies
9 Sep 2010, 1:30 AM
Thanks Jarred,

you confirm the solution I was thinking about.

Best Regards

Fab

maquejp
14 Feb 2011, 5:43 AM
Hi Fab,

At this time you cannot define a DataReader for your FormPanel nor your Stores. You can manually add the reader in your exported ".js" class file. Note: do not edit the .ui.js file, because it will be overwritten on every project export...the ".js" file is your implementation file, and it is not overwritten when it already exists on the file system.

Thanks,
Jarred

Is it in the next [february ;) ] version ?

This is the way to add the reader, I fought several minutes before remember that the reader is from basic form...



comp_fp_yourdetails = Ext.extend(comp_fp_yourdetailsUi, {

initComponent: function(){

comp_fp_yourdetails.superclass.initComponent.call(this);

this.getForm().reader = new Ext.data.XmlReader({

id: 'rd_comp_fp_yourdetails',

record: 'item',

success: '@success'

}, [{

name: 'cbTitle',

type: 'float'

}, {

name: 'tfAcademic',

type: 'string'

}])
}...