ExtJS: put an onclick event on an element with specific class
Hopef开发者_运维知识库ully 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
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.
精彩评论