如何给images添加事件。我的代码main_panel.add({
id : 'item' + (i + 1),
title : i + 1 + "号仓门",
anchor : '20%',
items : [{
id : 'img' + (i + 1),
// hidden:true,
xtype : 'box',
width : 70,
height : 60,
style : '',
autoEl : {
tag : 'img',
src : imgSrc
// 指定url路径
},
listeners : {
"click" : function() {
Ext.Msg.alert("提示",
"欢迎学习ExtJS。");
}
}
}]
});
id : 'item' + (i + 1),
title : i + 1 + "号仓门",
anchor : '20%',
items : [{
id : 'img' + (i + 1),
// hidden:true,
xtype : 'box',
width : 70,
height : 60,
style : '',
autoEl : {
tag : 'img',
src : imgSrc
// 指定url路径
},
listeners : {
"click" : function() {
Ext.Msg.alert("提示",
"欢迎学习ExtJS。");
}
}
}]
});
解决方案 »
- 请问_proto_是什么啊?有没有用到的地方
- 怎么触发的js
- 求解一直都很不明白的一个问题关于ajax jquery js
- 关于UserDAO.java与DaoImplFactory.java??
- 用正则表达式匹配字符串
- 疯了,setAttribute(key,value)方法的问题。急
- 取JS数组下标的问题
- 在FF里面取到鼠标位置
- 怎样用鼠标动态更改table中行的行高,table总高度不变,调整相邻行高度大小?
- 还是我!为什么没有人回答我呢!请问:如何禁止网页保存?效果就像我例子中的效果!帮帮忙!大虾!我急(例:http://www.37c.com.cn/info/
- 动态创建图片问题,请高手帮忙!
- FF下怎么在input中输入中文完成后触发事件
listeners : {
render : function() {// 渲染后添加click事件
Ext.fly(this.el).on('click',
function(e, t) {
var p = Ext.getCmp("p_"
+ t.id);
if (openRoomIds[saveImg[t.id]] == 1) {
openRoomIds[saveImg[t.id]] = 0;
p
.setTitle(saveImg[t.id]); } else {
openRoomIds[saveImg[t.id]] = 1;
p
.setTitle(saveImg[t.id]);
p.setTitle(p.title
+ "√");
}
}); }
}