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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:29:26+00:00 2026-06-07T09:29:26+00:00

In ExtJS 4 the new feature is Model-View-Controller architecture. Yet ExtJs4 examples are made

  • 0

In ExtJS 4 the new feature is Model-View-Controller architecture. Yet ExtJs4 examples are made for some simplified cases and thus violating that ideology.

I have created a standard hierarchy of MVC javascript files (controller, view, model, store). In view file, I have at some point a button.

If you check the examples online, it’s typically such code:

 items: [
                    {
                        xtype: 'button',
                        styleHtmlContent: true,
                        text: 'Upload image',
                        flex: 1,
                        formBind: false,
            handler: function() {...}
            ...
                      }]

so even ExtJS4 examples are “suggesting” to put executable part inside form definition. While MVC does require all action to reside in controller javascript file.

Another issue is the actioncolumn in a table. Below is a definition of the column in standard table configuration:

    xtype: 'actioncolumn',
     width: 50,
     fixed: true,
     altText: 'Actions',
      items: [
                  {
         icon: '/delete.png',
         tooltip: 'Delete',
         handler:function (grid, rowIndex,colIndex){
                ...}

The thing is, here handler accepts some grid-specific parameters!

Just for reminder, in extjs 4 canonical example of controller file is something like

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

 onButtonClick: function(button, e, options) {
  //  alert("Button has been clicked "+button);
     // TODO which button?

},

init: function() {
    this.control({
        "button": {
            click: this.onButtonClick
        }
    });

}
});

My question is how to rearrange the code in order to:
1. remove handler: directives from any button on screen
2. attach actions to buttons in the controller file, including, of course, separate action for separate buttons.
3. Do the same for actioncolumn table columns, and successfully recognise which action on which row and column was triggered (that is, completely transfer function call from “handler” to controller file).

Thanks in advance, Askar

  • 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-07T09:29:27+00:00Added an answer on June 7, 2026 at 9:29 am

    The ExtJs examples are not all up-to-date with the MVC architecture. What’s more, MVC is not a compulsory design – some users might prefer not using it, so still important to show examples without MVC.

    Pretty much everything you’ve asked is answered in this docs tutorial.

    With regards to 3: I think it is some misleading from your part. Although you do define `this.onButtonClick’ in your controller, the called function will still get all the parameters, just like your button handler method would – the caller component is usually the first parameter delivered with each event. You can, of course, just define more specific selectors using actions or ids in your controller. Again see the link above for an example.

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

Sidebar

Related Questions

I'm fairly new to ExtJS. I adopted some examples and added the functionality to
I am creating a new ExtJS widget using Ext.view.View. The template for this view
I'm currently playing with ExtJS 4 for my new project. I'm using MVC architecture
I am new to ExtJs and I am using ExtJs4. Now As shown in
I m new to ExtJs. I was wondering if there's some way wherein i
Am working in EXTJS 4.1 MVC Architecture. Am completely new to this, and i
In my extjs column model, here is what i have: new Ext.grid.ColumnModel({ columns: [
I am new to ExtJS. In examples, I do not find any one similar
Am new to EXTJS. Can anyone explain me the relation between EXTJS and JSON
I'am new to extJS and maybe I just don't know the correct strategy, so

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.