我可以根据他们的课程点击图片吗? jquery中的示例是$(.imageID).click()
;
<img src="picture.png" class="imageClass">
如何点击EXT JS 5+中的事件或火灾事件?
答案 0 :(得分:0)
Ext.select('.imageClass').each(function(item){
item.fireEvent('click', item);
});
应在类.imageClass
答案 1 :(得分:0)
您可以使用Ext.select()
来获取您所追求的行为。
Ext.select('.pic').on('click', function() { alert('Mew!'); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/ext-all.min.js"></script>
<img src="https://placekitten.com/g/200/300" class="pic" />
答案 2 :(得分:0)
Firing UI events programmatically is very, very bad practice, unless you are testing the application. So if you are not testing, just call the handler directly and do not simulate clicks this way.