1 嵌入函数
2
'<tpl if="xindex==1 && imagePath!=null">' +
'<img width="100" height="80" src="viewPhoto.do?path={imagePath}"/>' +
'</tpl>'+
new Ext.XTemplate('<tpl if="isSameUnit(a,b,c)==true">'.</tpl>..,{
isSameUnit : function(unit1, unit2, unit3) {
return ((unit1 == unit2) && (unit1 == unit3));
}
}
)
2
'<tpl if="xindex==1 && imagePath!=null">' +
'<img width="100" height="80" src="viewPhoto.do?path={imagePath}"/>' +
'</tpl>'+
本文介绍了一种使用自定义函数的模板引擎实现方式,通过具体的代码示例展示了如何在模板中嵌入逻辑判断,并提供了单元一致性检查的功能。该方法允许开发者在模板中根据条件显示内容,如图片等。
198

被折叠的 条评论
为什么被折叠?



