最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ExtJS: put an onclick event on an element with specific class - Stack Overflow

programmeradmin2浏览0评论

Hopefully the title is self explanatory, but I want to put an .on('click',function(){...}) type thing on divs with a specific class.

Hopefully this is simple and I have just skimmed over something...

thanks in advance

Hopefully the title is self explanatory, but I want to put an .on('click',function(){...}) type thing on divs with a specific class.

Hopefully this is simple and I have just skimmed over something...

thanks in advance

Share Improve this question asked Feb 25, 2011 at 5:43 neolaserneolaser 6,90719 gold badges59 silver badges92 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You can use Ext.select to select a bunch of elements and issue a single on on all of them at once:

Ext.select(".mydivs").on("click", function () { ...

From the API doc:

Although they are not listed, this class supports all of the methods of Ext.Element and Ext.Fx. The methods from these classes will be performed on all the elements in this collection.

发布评论

评论列表(0)

  1. 暂无评论