1

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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

in the function, can I refer to the specific one that was clicked?
Yes.The second argument to your callback will be the clicked element. dev.sencha.com/deploy/dev/docs/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.