View Full Version : Event Delegation on XTemplate for ComboBox

12 Aug 2013, 4:05 PM
I am currently using a component that extends a ComboBox. I have read about the delegate feature that was introduced in 3.4.0 that can be used to distinguish between different classes, but I am stuck on 3.3.3 for reasons that are out of my control. Is there any way to do something similar on ExtJs 3.3.3 or older?

I basically have a pretty basic template and I want to distinguish between multiple items on a single row.

Below is a post with someone who has had the same problem, but the solution only works for 3.4.0
Help would be greatly appreciated. Thanks!!

http://www.sencha.com/forum/showthread.php?228429-Event-Delegation-in-custom-html-element-into-xtemplate&p=988403#post988403 (http://www.sencha.com/forum/showthread.php?228429-Event-Delegation-in-custom-html-element-into-xtemplate&p=988403#post988403)

14 Aug 2013, 11:09 AM
You may also be able to get what you're looking for using the eventObject's getTarget method.

The first param you'd pass is the selector that you're wanting to test for - so very similar to the use of delegate in this respect. You'd just test for the click to have happened on the desired target (or multiple tests if various actions should take place) and proceed according to the click location.