我想個性化列表的標題組。所有的 首先我有這個功能,CONCAT n次的字符串:sencha觸摸列表的組模板
String.prototype.times = function(n) {
return Array.prototype.join.call({length:n+1}, this);
};
所以我想重複n次的IMG HTML標記:
var list = new Ext.List(
{
height : document.height - 150,
itemTpl : "<div>blabla..</div>",
store : listStore,
groupTpl :[
'<tpl for=".">',
'<div class="x-list-group x-group-{id}">',
'<h3 class="x-list-header">'+ '<img height="20" src="imgPath"/>'.times("{group}")+ '</h3>',
'<div class="x-list-group-items">',
'{items}',
'</div>',
'</div>',
'</tpl>'
],
grouped : true
});
不過,這並不在所有的工作,我認爲「{組}」值不會替換爲JavaScript執行。但我該如何處理?
我不知道你是否收到我的答覆通知我的編輯。 – Prusse