sencha在list中如果使用XTemplate似乎是没有法子控制img标签的事件
var myTemplate = new Ext.XTemplate(
'<td width="40" rowspan="3"><img src="avatar/{account}.png" width="36" height="36" onerror="noimage(this)" />',
);
所以在img的onerror事件中写函数 noimage,然后函数加在那里呢?
加在list的html实验不成功
最后加载index.html中靠谱
function noimage(img) {
img.src='resources/img/ic_contact.png';
}

本文详细探讨了在使用Ext JS时如何通过XTemplate在List组件中控制img标签的onerror事件,提供了将事件处理函数noimage整合至模板的方法,并通过实例演示了如何在加载index.html中实现事件触发。
918

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



