1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    53
    Vote Rating
    2
    manilodisan is on a distinguished road

      0  

    Default Controller listener for a link

    Controller listener for a link


    I'm just starting to play with the new MVC structure and I have a small issue. I'm building a small admin menu on the left side with some panels and links inside those panels as an admin menu. How do I place an event listener inside my controller to listen for certain links when they are clicked? All I try seems to fail for some reason and no action is triggered.

    My application:
    PHP Code:
    Ext.define('AM.controller.Users', {
        
    extend'Ext.app.Controller',
        
    stores: ['Users'],
        
    models: ['User'],
        
    init: function() {
            
    this.control({
                
    //    mainMenu is a panel holding the navigation links
                //    that I wish to "watch/listen"
                
    'mainMenu a[class=usersList]': {
                    
    itemclickthis.launchUsers
                
    }
            });
        },
        
    launchUsers: function () {
            
    alert('test');
        }
    }); 
    link with class "usersList" exists, "mainMenu" widget exists...everything seems in order just that I have no action triggered.

    Any helps is much appreciated, thanks.

  2. #2
    Ext JS Premium Member
    Join Date
    Dec 2010
    Posts
    29
    Vote Rating
    0
    OpnSrce is on a distinguished road

      0  

    Default


    Try changing your listener from itemclick to just 'click'

Similar Threads

  1. Link Button or Hyper link
    By nikhilwalker in forum Ext 2.x: Help & Discussion
    Replies: 69
    Last Post: 24 May 2013, 5:13 AM
  2. How to attach a extjs object function as listener to hyper link button
    By valfumble in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 18 Jan 2011, 12:22 PM
  3. View, Controller and RPC
    By sdc in forum Community Discussion
    Replies: 2
    Last Post: 13 Dec 2008, 3:46 AM
  4. Adding Button or HTML link with listener within Template
    By hilmi in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 25 Sep 2008, 2:23 AM
  5. Spring Controller
    By erwin in forum Community Discussion
    Replies: 6
    Last Post: 7 Aug 2008, 7:06 PM

Thread Participants: 1