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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:19:53+00:00 2026-06-15T23:19:53+00:00

Back Ground : I am working on an MVC application using sencha touch 2.

  • 0

Back Ground : I am working on an MVC application using sencha touch 2. I am working on a page which has two tabs. Inside the first tab, I have a button inside a title bar.

Issue : I am not able to call anyother function from the button handler. I think, there is an issue with the scope of the calling function.

Here is my code.

Ext.define('WUPOC.view.WUHomePage', {
  extend: 'Ext.TabPanel',
  requires:['Ext.TitleBar','Ext.dataview.List','Ext.data.proxy.JsonP'],
  alias: 'widget.wuHomePageView',

  config: {
    fullscreen: true,

    defaults: {
      styleHtmlContent: true
    },

    items: [{
      title: 'Home',
      iconCls: 'home',

      items: [{
        xtype: 'titlebar',
        title: 'Hello',
        docked: 'top',
        items: [{
          xtype: 'button',
          text: 'LogOut',
          ui: 'action',
          itemId: 'newButton',
          align: 'right',
          handler : function(btn){
            console.log('LogOut is tapped');  // This is printed
            this.up.onNewButtonTap();  // Throws error
          }
        }],
      }],
    }, {
      title: 'Contact',
      iconCls: 'user',
      html: 'Contact Screen'
    }]
  },

  onNewButtonTap: function () {
    alert('newNoteCommand');
  },
});

I am getting the error as below.

Uncaught TypeError: Object function (selector) {
        var result = this.parent;

        if (selector) {
            for (; result; result = result.parent) {
                if (Ext.ComponentQuery.is(result, selector)) {
                    return result;
                }
            }
        }
        return result;
    } has no method 'onNewButtonTap' 

I think there is an issue with setting the scope of a button. Kindly help.

Thank you

  • 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-15T23:19:54+00:00Added an answer on June 15, 2026 at 11:19 pm

    First, up is a function so you need to call it this way :

    this.up();
    

    Then this.up() would only bring to the container of the button, which has no method onNewButtonTap. You could just keep doing up() until you get the right component but this would me more clever to do :

    • Add an xtype to your view
    • Use this xtype as a selector in the up function : this.up('myXType').onNewButtonTap();

    Example

    Hope this helps

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

Sidebar

Related Questions

I'm working with both silverlight and asp mvc. The silverlight application performs a page
First some background, I am currently working on a relatively large Asp.Net MVC application
I am working on a MVC site which are having two separate views for
First some background: I'm working on an application and I'm trying to follow MVVM
On Friday I gave a demo of an MVC application using the Authorize attribute
Background I'm working on building an ASP.Net MVC 3 application that utilizes: JQueryUI for
I'm using jQuery in my ASP.NET MVC 2 page. It's a super simple post
I have a website using ASP.NET MVC, everything was working fine, but I'd like
Background: I am working on an ASP.NET MVC app that has 3 partials (based
I'm working on an ASP.NET MVC 3 application. I primarily come from a ASP.NET

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.