在我的JSON结构中,我有一个对象:
[{ id: 1, name: xxxxx, operation1: { startdate: 2011-10-25, enddate: 2011-11-25 }, operation2:{......}}]
为了显示操作日期,我需要访问stardate和enddate但是如何?
我试过
{header:'operation1', xtype:'templatecolumn', tpl:'<span>{operation1.startdate}</span>', align:'center'}
实际上,我是动态创建列的:
for(var i=1;i<=31;i++){
this.columns.push({header:i, xtype:'templatecolumn', tpl:'<span>{operation'+i+'.startdate}</span>', align:'center'});
}
答案 0 :(得分:2)
很可能您忘记将operation1
添加到字段中。查看this working demo
fields: ['id', 'name', 'operation1', 'operation2']