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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:04:39+00:00 2026-05-30T08:04:39+00:00

I have a controller defined like this: Ext.define(‘MyApp.controller.TestController’, { extend: ‘Ext.app.Controller’, config: { },

  • 0

I have a controller defined like this:

Ext.define('MyApp.controller.TestController', {
    extend: 'Ext.app.Controller',

    config: {

    },

    showTest: function() {
        alert('aaa');
    }

}); 

How can i call the showTest() function? I tried this:
MyApp.controller.TestController.showTest();

But this doesn’t work. Anyone any idea how to do this..?? Because i want to call that function from an onClick even in a div. Something like:

<div onclick="call.controller.func(1)">User 1</div>
<div onclick="call.controller.func(2)">User 2</div>
etc.
  • 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-05-30T08:04:40+00:00Added an answer on May 30, 2026 at 8:04 am

    No, you are doing it wrong.

    Suppose that you have a button in your view:

    Ext.define('MyApp.view.Login', {
    extend : 'Ext.form.Panel',
    xtype  : 'myapp-login',
    
    config : {
        items  : [
            {
                xtype   : 'fieldset',
                name    : 'login-fieldset',
                title   : 'Login credentials',
                instructions: 'Fill in your email and password)',
                items   : [
                    {
                        xtype: 'emailfield',
                        name : 'email',
                        label: 'Email'
                    },
                    {
                        xtype: 'passwordfield',
                        name : 'password',
                        label: 'Password'
                    }
                ]
            },
            {
                xtype : 'button',
                name  : 'Login',
                text  : 'Login',
                ui    : 'confirm'
            }
        ]
    }
    });
    

    The in your controller, inside your control object:

    control : {
       'myapp-login button[ui=confirm]' : {
          tap : 'showTest'
       }
    },
    
    // function showTest
    showTest: function() {
        alert('aaa');
    }
    

    So in the above example: when user clicks inside the xtype called myapp-login the controller will execute the showTest() method.

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

Sidebar

Related Questions

I have this controller: Ext.define('MyApp.controller.Test', { extend: 'Ext.app.Controller', config: { }, refs: [ {
I have a spring controller defined like this: @Controller @RequestMapping(/user) class UserController { ...
I have an MVC controller method defined like this: public ActionResult GetPdf(string filename) {
So I have a route defined like this for my evisit controller and all_messages
I have my default route defined like this routes.MapRoute( Default, // Route name {controller}/{action}/{id},
I have a view outlet in my view controller. It's defined like this: IBOutlet
I have a route defined like this: routes.MapRoute(Date, Date/{year}/{month}/{day}, new { controller = Date,
i have a controller like this one : <?php if( ! defined('BASEPATH')) exit ('No
I have a model like this defined... public class Product{ private long timestamp; //
I have a function defined in a module called DataAccess like this module DataAccess

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.