flatburger
14 Oct 2007, 2:58 AM
i found this
JsonReader( Object meta, Object recordType )
in my side this mean:
1. meta will have a object
2. the recrd type is the field
reader : new Ext.data.JsonReader({
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
]),
but after i try to read this json
{
response:{
success:'true',
contact:{
name:{
first:'Jack',
last:'Slocum'
},
company:'Ext JS',
email:'support@extjs.com',
state:'OH',
dob:'04/15/2007'
}
}
}
and this one also
{
success:'true',
contact:{
name:{
first:'Jack',
last:'Slocum'
},
company:'Ext JS',
email:'support@extjs.com',
state:'OH',
dob:'04/15/2007'
}
}
both cannot work.
any idea how to map the json with the array? so i can use it in fieldset.
F
JsonReader( Object meta, Object recordType )
in my side this mean:
1. meta will have a object
2. the recrd type is the field
reader : new Ext.data.JsonReader({
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
]),
but after i try to read this json
{
response:{
success:'true',
contact:{
name:{
first:'Jack',
last:'Slocum'
},
company:'Ext JS',
email:'support@extjs.com',
state:'OH',
dob:'04/15/2007'
}
}
}
and this one also
{
success:'true',
contact:{
name:{
first:'Jack',
last:'Slocum'
},
company:'Ext JS',
email:'support@extjs.com',
state:'OH',
dob:'04/15/2007'
}
}
both cannot work.
any idea how to map the json with the array? so i can use it in fieldset.
F