Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8440747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:22:37+00:00 2026-06-10T08:22:37+00:00

Having trouble and not sure how to proceed with debug. Found a question that

  • 0

Having trouble and not sure how to proceed with debug. Found a question that looks almost exactly like mine, however the solution doesn’t work: How to catch tree node clicks from a (MVC) controller in ExtJs 4?

The only difference I can see between that question and mine is that my tree is created directly within my layout as an item object using xtype of treepanel where that one is created separately.

Here is my controller:

Ext.define("IOL.controller.app.AppLayout", {
    extend: 'Ext.app.Controller',
    init: function() {
        this.control({
            'app toolbar > button[itemId=filter]' : {
                click: this.onFilter
            },
            'menuTree': {
                itemclick: this.onFilter
            }
        });
    },

    onFilter: function(btn) {
        alert('test');
        Ext.create('IOL.view.app.Home').show();
    }

});

Here is the relevant item from my view:

{
        xtype: 'treepanel',
        title: 'Navigation',
        split: true,
        collapsible: true,
        margins: '5 0 5 5',
        region: 'west',
        width: 170,
        id: 'menuTree',
        alias: 'widget.menuTree',
        store: Ext.create('IOL.store.app.AppNav'),
        useArrows: true,
        rootVisible: false
        /*listeners : {
            itemdblclick : function(view,rec,item,index,eventObj) {

                console.log(view);
                console.log(rec);
                console.log(item);
                console.log(index);
                console.log(eventObj);
                if(rec.get('leaf') == true){
                    Ext.ComponentQuery.query('tabpanel')[0].add({
                        xtype: 'panel',
                        title: rec.get('text'),
                        itemId: rec.get('id'),
                        //url: 'server/HomeTab/read.php',
                        html : 'test content name: ' + rec.get('id'),
                        closable : true
                    });
                }

            }
        }*/
    }

The control for the button app toolbar > button[itemId=filter] works, however assigning the same action to the ‘menuTree’ does not work. Browser console brings back a valid object with Ext.getCmp('menuTree') so I’m lost as to why the controller does not seem to be acting on the tree.

The tree is loading from a store, which makes me wonder if this is a similar scenario to where one would need to use .on('click') rather than .click() in jQuery…almost like the controller is not seeing the tree (but sees the button in the same view?). I purposely commented out the handler directly on the tree (which does work).

Can provide all the files if it would help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:22:39+00:00Added an answer on June 10, 2026 at 8:22 am

    Ext.getCmp() returns components by id, while Controllers use Ext.ComponentQuery.query() syntax to find their components; so effectively you’re trying to control a component with xtype menuTree that doesn’t exist. You should use either ‘#menuTree’ or ‘treepanel’ as your selector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble with preg_replace and I'm not sure that I use correct function.
I am having trouble with this setup mainly because I am not sure what
I'm having trouble getting a JTextArea to scroll. I'm not sure how you can
I am not sure of the terminology so am having some trouble finding leads.
I'm having trouble with insertRowsAtIndexPaths:. I'm not quite sure how it works. I watched
I'm having trouble setting the path to a DLL that is not in the
I'm not sure what this is called, which is why I'm having trouble searching
I'm having trouble not being too familiar with how to debug such problems. In
I'm having trouble using one Lua lib from inside another. I'm not sure about
I'm not sure why, but I'm having trouble passing a data object (NSManagedObject) to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.