Javascript Sencha touch json保存为原始数据而不是数据
我有下面的JSON {pic:[{id:10,title:Perro,description:Un-lindo perrito,puntos:300,ext:jpeg,image\u time:2014-07-28 03:58:31,data:,URL:pug.jpeg},{id:12,title:Pugs,description:\u00danete a la fuerza,puntos:123,ext:jpeg,image\u time:2014-07-30 07:05:42,data:,URL:image.jpg},{id:14,标题:burro,描述:lindo burro,puntos:678,分机:png,图片时间:2014-07-30 16:25:44,数据:,URL:1456105_475563429279_7985916_n.png} 以及以下模型:Javascript Sencha touch json保存为原始数据而不是数据,javascript,json,extjs,sencha-touch,Javascript,Json,Extjs,Sencha Touch,我有下面的JSON {pic:[{id:10,title:Perro,description:Un-lindo perrito,puntos:300,ext:jpeg,image\u time:2014-07-28 03:58:31,data:,URL:pug.jpeg},{id:12,title:Pugs,description:\u00danete a la fuerza,puntos:123,ext:jpeg,image\u time:2014-07-30 07:05:42,data:,U
Ext.define('hptest2.model.pic', {
extend: 'Ext.data.Model',
config: {
idProperty: 'id',
fields: [
{name: 'id', type: 'int'},
{name: 'URL', type: 'String'},
{name: 'puntos', type: 'int'},
{name: 'title', type: 'String'},
{name: 'descripcion', type: 'String'},
{name: 'data', type: 'String'},
{name: 'ext', type: 'String'},
{name: 'image_time', type: 'String'},
]
}
});
及其商店:
Ext.define('hptest2.store.pic', {
extend: 'Ext.data.Store',
config: {
model: 'hptest2.model.pic',
proxy: {
type: 'ajax',
url: 'data/pic.php'
},
reader: {
type: 'json',
rootProperty: 'pic'
}
}
});
但当我在视图上使用tpl时……我就是无法访问存储中的数据
视图:
{
title: 'Promociones',
iconCls: 'star',
items: [
{
xtype: 'panel',
store : 'pic',
tpl:new Ext.XTemplate('<div>{URL} with {puntos}</div>'),
}
]
}
但在data->all->data->raw中,我能够可视化我希望通过视图访问的所有数据
pic: Array[3]
0: Object
URL: "pug.jpeg"
data: ""
descripcion: "Un lindo perrito"
ext: "jpeg"
id: "10"
image_time: "2014-07-28 03:58:31"
puntos: "300"
title: "Perro"
__proto__: Object
1: Object
2: Object
pic: Array[3]
0: Object
URL: "pug.jpeg"
data: ""
descripcion: "Un lindo perrito"
ext: "jpeg"
id: "10"
image_time: "2014-07-28 03:58:31"
puntos: "300"
title: "Perro"
__proto__: Object
1: Object
2: Object