0
我想在itemTpl中添加圖像取決於「if」語句。任何人都可以幫我解決這個問題嗎?根據條件添加圖像到itemTpl
這裏是我的代碼,
//Controller
for(var i=0;i<len;i++){
//Storing our values in Array
var st = {
'Amount':jsonarr.AgentTransactionResult[i].Amount,
'TransactionId':jsonarr.AgentTransactionResult[i].TransactionId,
'Status':jsonarr.AgentTransactionResult[i].Status,
'Date':jsonarr.AgentTransactionResult[i].Date,
};
//Adding our array to LocalStore(localStorage)
var localStore = Ext.getStore('transstore');
localStore.add(st);
localStore.sync();
localStore.load();
}//for loop
//View
xtype: 'list', store : 'transstore', html:'<table border="0" width="100%"><th><td width="25%">Amount</td><td width="25%">Status</td><td width="25%">Date</td><td width="25%">Transaction Id</td></th></table>', itemTpl:
'<table border="0" width="100%">'+
'<tr>'+
'<td width="10%"><font size="2" color="#000000"><b>{Amount}</b></font></td>'+
'<td width="20%"><font size="2" color="#003300"><b>{Status}</b></font></td>'+
'<td width="23%"><font size="2" color="#003300"><b>{Date}</b></font></td>'+
'<td width="8%"><font size="2" color="#003300"><b>{TransactionId}</b></font></td>'+
'</tr>'+
'</table>'.
和香港專業教育學院,以顯示我的圖像格式狀態。如果(狀態==「成功」)返回「IMG網址」,否則返回「另一個IMG網址」。我已經從webservice中檢索到狀態,但我不知道如何更改圖像。誰能幫我這個?
我有回答我的查詢朋友..... – ajantha