Results 1 to 2 of 2

Thread: event element clicked in controller

  1. #1
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    123
    Vote Rating
    0
      0  

    Default event element clicked in controller

    Hi,

    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:

    Code:
    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:

    Code:
        	
        this.control({
    	        '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.

  2. #2
    Sencha User
    Join Date
    Nov 2012
    Posts
    432
    Answers
    11
    Vote Rating
    10
      0  

    Default

    Try herehttp://docs.sencha.com/extjs/4.2.2/#!/api/Ext.dom.Element

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •