1
我有一個對象:ExtJS4網格:顯示對象在我的JSON結構
[{ id: 1, name: xxxxx, operation1: { startdate: 2011-10-25, enddate: 2011-11-25 }, operation2:{......}}]
,以顯示操作日期,我需要訪問stardate和結束日期,但如何?
我試圖
{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'});
}
Typo? 'tpl:' {'+ i +'。startdate}''yield'tpl:' {1.startdate}'','tpl:' {2.startdate}''...等等 –
對不起,這是一個錯誤:'tpl:' {operation'+ i +'。startdate}'' –
問題解決了嗎?你能分享一點點,所以我們知道它有什麼問題:)乾杯! –