View Full Version : Template won't show children for Yahoo weath\

9 Sep 2011, 2:47 PM
I'm trying to perform a simple loop to show weather information from yahoo. The json includes a collection of weather forecast objects that will not show. Looking at the object in Chrome shows two "forecasts" objects in the array, so it appears the data is being pulled in correctly. Temperature below shows fine, so it's getting the root no problem. Thoughts?

The data

"id":1,"Code":"30","Temperature":"79","Text":"Partly Cloudy",
"Location":"Waltham, MA"}],"id":1,"PageTitle":""

The template

itemTpl: new Ext.Template(
"<tpl for='.'>",
"<tpl for='forecasts'>",
"<span> {Day} {Low} {High}</span>",

The Models

Ext.regModel('App.Area.Home.Widgets.Models.Weather', {
fields: ['id','Code', 'Link', 'Temperature', 'Text', 'Location'],
associations: [{type: 'hasMany', model: 'App.Area.Home.Widgets.Models.Forecasts', name: 'forecasts'}],
Ext.regModel('App.Area.Home.Widgets.Models.Forecasts', {
fields: ['id','Code', 'Low', 'High', 'Day'],
associations: [{type: 'belongsTo', model: 'App.Area.Home.Widgets.Models.Weather'}],
storeId: 'App.Area.Home.Widgets.Store.Weather',
model: 'App.Area.Home.Widgets.Models.Weather',
proxy: { type: 'ajax', url: 'Data.txt',
reader: {type:'json', root:'weather'},

Pulling my hair out on this one... it's not rocket science is it? :)