View Full Version : event element clicked in controller

19 Dec 2013, 12:45 AM

I want to catch the event when a user click on a link in one of my view. I would like to define the listener in my controller.

I do it like this... In my controller I define a listener on the event that my link was clicked. I do that after my grid was rendered:

onGridRendered: function(grid){
grid.el.on("click", this.onIpAddressClicked, this, {delegate:"a.whoisIp"})

Now, as I said, it works, but I am not sure what this line is all about.
What is the el in grid.el?
I don't know where to find this information in the API.

Would there not be another way to define this in the controller? Something like:

'myGrid': {
render: this.onGridRendered
,'myGrid > a.whoisIp': {
click : {
fn: this.onIpAddressClicked,
options:{element: 'el'},
scope: this

I don't grasp the notion of el and delegate. Could someone guide me to a place where I could read about it?

Thanks for your help.

Kevin Jackson
31 Dec 2013, 10:46 AM
Try herehttp://docs.sencha.com/extjs/4.2.2/#!/api/Ext.dom.Element