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 8236359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:06:35+00:00 2026-06-07T19:06:35+00:00

I have an MVC app which has a Tab Panel rendered as the only

  • 0

I have an MVC app which has a Tab Panel rendered as the only item in the viewport. Within the tabs I would like to put the same type of component, for which the event handling is equal within all tabs.

Therefore I need an ExtJS MVC Controller ref to the active tab, that would lead me to execute events on the components in the active tab. Is it possible to have such a ref?

My current approach is this:

  1. get reference to Tab Panel
  2. call getActiveTab()
  3. call the controller events for the component in active tab

Is it possible to encapsulate the above 3 steps in one controller ref? Would be beautiful 🙂

I’m using ExtJS 4.1.

  • 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-07T19:06:37+00:00Added an answer on June 7, 2026 at 7:06 pm

    Personally, I think controller refs are overrated. This sounds like a simple case where you can use one as you describe, but I prefer to listen to the event, and navigate from the firing component to the one I need.

    In your case, assuming your tab panel contains regular ext panels, I’d do something like the following:

    onButtonClick: function (button) {
        var panel = button.up('panel[tab]');
    
        if (panel) {
            panel.someMethod();
        }
    }
    

    The up method will find the closest ancestor that is of xtype panel and has a property named tab. If you have more specific xtypes or known properties, use those instead.

    The panel should be the active one (else how was its button clicked?) but you can check that by going up another level to the tab panel and getting the activeTab there.

    onButtonClick: function (button) {
        var panel = button.up('panel[tab]'),
            tabPanel = button.up('tabpanel'),
            activeTab = tabPanel && tabPanel.getActiveTab();
    
        if (panel && panel === activeTab) {
            panel.someMethod();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC app in Extjs 4 which has a View (extending Ext.panel.Panel
I have an MVC app which has its routes defined with the final route
I have an ASP.MVC application which has a silverlight app inside. I want to
I have successfully created a asp mvc app which basically has interface, service and
I have an ASP.NET MVC app which has a bootstrapper class that configures log4net
I have an asp.net mvc app which has membership implemented. So a user has
I have an ASP.NET MVC web app which has a really basic subscription system
I have an MVC 3 web app that has an Action which I need
Within an asp.net MVC app, I'm trying to find rooms which have a guest/client,
In my ASP.NET MVC app, I have a fairly complex edit page which combines

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.