bluefox617
18 Apr 2011, 10:08 AM
I know this may be a silly question but I really need your help.
here is callback json file
{
"status": "OK",
"routes": [ {
"summary": "I-40 W",
"legs": [ {
"steps": [ {
"travel_mode": "DRIVING",
"start_location": {
"lat": 41.8781100,
"lng": -87.6297900
},
"end_location": {
"lat": 41.8757000,
"lng": -87.6296900
},
"polyline": {
"points": "eir~FdezuO`NS",
"levels": "BB"
},
"duration": {
"value": 34,
"text": "1 mins"
},
"distance": {
"value": 269,
"text": "0.2 km"
}
},
.....
]}
and I need some of these fields in my app,like routes.legs[i].start_location.lat.....
but I don't know how to get it and how to set my model or set tpl in view.
please hlep me ~~~
Ext.regModel("GdirctionModel", {
fields: [
{name: "start_lat", type: "string"},
{name: "start_lng", type: "string"},
.......
],
proxy: {
type: 'ajax',
url : 'geotest.json',
reader: {
type: 'json',
root: 'legs'
}
}
});
here is callback json file
{
"status": "OK",
"routes": [ {
"summary": "I-40 W",
"legs": [ {
"steps": [ {
"travel_mode": "DRIVING",
"start_location": {
"lat": 41.8781100,
"lng": -87.6297900
},
"end_location": {
"lat": 41.8757000,
"lng": -87.6296900
},
"polyline": {
"points": "eir~FdezuO`NS",
"levels": "BB"
},
"duration": {
"value": 34,
"text": "1 mins"
},
"distance": {
"value": 269,
"text": "0.2 km"
}
},
.....
]}
and I need some of these fields in my app,like routes.legs[i].start_location.lat.....
but I don't know how to get it and how to set my model or set tpl in view.
please hlep me ~~~
Ext.regModel("GdirctionModel", {
fields: [
{name: "start_lat", type: "string"},
{name: "start_lng", type: "string"},
.......
],
proxy: {
type: 'ajax',
url : 'geotest.json',
reader: {
type: 'json',
root: 'legs'
}
}
});