0
我有以下的模型,ExtJS Store加载不正确?
Ext.define('Forecaster.model.WeatherDay', {
extend : 'Ext.data.Model',
fields : [
{
name : 'version',
type : 'string',
mapping : 'version'//'forecast.simpleforecast.forecastday.date.pretty'
}
]
});
正在使用由下列存储
:
Ext.define('Forecaster.store.WeatherDay', {
extend : 'Ext.data.Store',
model : 'Forecaster.model.WeatherDay',
autoLoad : true,
proxy : {
type : 'jsonp',
method : 'GET',
url : 'http://api.wunderground.com/api/[apiKEY]/forecast10day/q/11432.json',
reader : {
type : 'json',
rootProperty : 'response'
}
}
});
但存储为空。当我做到以下几点:
console.log(store.getProxy().getReader().rawData);
以下是打印出来(所以店里正在接收数据):
对应于以下JSON,我接受:
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"forecast10day": 1
}
}
,
"forecast":{
"txt_forecast": {
"date":"5:18 PM EDT",
"forecastday": [
{
"period":0,
"icon":"cloudy",
"icon_url":"http://icons.wxug.com/i/c/k/cloudy.gif",
...more of the response...
因为我清楚地接收到数据但商店是空的(getCount()返回0),我在映射到模型阶段时做了什么错误?