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

  • Home
  • SEARCH
  • 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 8254615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:15:05+00:00 2026-06-08T01:15:05+00:00

I am extending the example given in http://docs.sencha.com/architect/2-0/#!/guide/views_forms_extjs to use a more MVC centric

  • 0

I am extending the example given in http://docs.sencha.com/architect/2-0/#!/guide/views_forms_extjs to use a more MVC centric approach. So in service of that I want to move the on click handler from the view to a newly create controller.

I have the click even working fine, but I have no idea how to operate on the form from the context of the controller (the view was using this.getForm()).

Here is what I have so far,

Ext.define('LoginExample.controller.LoginController', {
    extend: 'Ext.app.Controller',


    onLoginButtonClick: function(button, e, options) {
        console.log('button clicked');


        if (this.getForm().isValid()) {
            this.getForm().submit({
                url: 'login.php',
                success: function(form, action) {
                    Ext.Msg.alert('Login Successful!');
                },
                failure: function(form, action) {
                    Ext.Msg.alert('Login Failed!');
                }
            });
        }
    },


    init: function() {
        this.control({
            "#loginButton": {
                click: this.onLoginButtonClick
            }
        });
    }

});

Obviously the this in the context of onLoginButtonClick is no longer the view and is instead the controller.

Given the parameters given to me, (Ext.button.Button button, Event e, Object options), how do I get the submit on the appropriate form?

I should note this using ExtJS 4.

  • 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-08T01:15:07+00:00Added an answer on June 8, 2026 at 1:15 am
    button.up('form');
    

    will do the trick.

    To get the BasicForm object to operate on, use

    button.up(‘form’).getForm()

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

Sidebar

Related Questions

Let's use custom or extending View as an example. Is it more effective to
So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html Here is the example: <definition name=myapp.homepage template=/layouts/classic.jsp> <put-attribute name=title
I have two classes in a PHP application, B extending A for example. Class
Should I include/require_once the parent class that I am extending in PHP? for example
How do I go about Authorization in MVC 2? I want to use AD
Let's take for example this class, which is extending MySQLDB's connection object. class DBHandler(mysql.connections.Connection):
I'm hoping that someone can provide a simple, straight forward example of extending the
I have created a Zend Framework model by extending Zend_Db_Table_Absract as follows (simplified example):
Im extending the UIButton Class to be able to set the font and color
I'm extending a constructor class' functionality via the prototype method, but I'm having trouble

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.