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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:49:29+00:00 2026-06-05T19:49:29+00:00

I tried to create base controller and write in it: Ext.define(‘My.Users.controller.Role’, { extend :

  • 0

I tried to create base controller and write in it:

Ext.define('My.Users.controller.Role', {
    extend      : 'Ext.app.Controller',
    stores       : [
        'Modules', 'ModulesList'
    ],
    models       : [
        'Modules', 'ModulesList'
    ]
});

But when I tried to use getters for them (in this base class, or in it’s child classes, like My.Users.controller.Group), like getModulesStore(), or getModulesListModel(), I have an error that them are not functions. And in Firebug I can see there aren’t this methods in child class and in it superclass. How can I to fix it?

The full description how to reproduce this bug:
1) Download ExtJS 4.1 GPL from Sencha

2) Unzip the archive, and go to directory extjs-4.1.0/examples/app/feed-viewer/

3) In file feed-viewer.html comment line <script type="text/javascript" src="all-classes.js"></script> to force dynamic loading of js files: now you can normally edit the content of project files.

4) In folder app/controller create file named Entities.js with following code:

Ext.define('FV.controller.Entities', {
    extend: 'Ext.app.Controller',
    models: ['Shared'],
    stores: ['Shared']
});

5) In files Articles.js and Feeds.js change extend to ‘FV.controller.Entities’

6) In folders app/model and app/store create files Shared.js with content

Ext.define('FV.model.Shared', {
    extend: 'Ext.data.Model',
    idProperty: 'id',
    fields: [
    {
        name: 'id',
        type: 'int'
    },
    {
        name: 'title',
        type: 'string'
    }
    ]
}); 

for Model and

Ext.define('FV.store.Shared', {
    extend: 'Ext.data.Store',
    model: 'FV.model.Shared',
    proxy: {
        type: 'ajax',
        url: 'test.json',
        reader: {
            type: 'json',
            root: 'item'
        }
    }
});

for Store.

7) Finally, for example, in init method of Article.js try to console.log(this);
In Firebug you will not get getSharedModel() and getSharedStore() methods.

I’ve uploaded my sample to http://nekaka.com/d/W1_EOlnPST

  • 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-05T19:49:30+00:00Added an answer on June 5, 2026 at 7:49 pm

    models and stores are config properties. If you look at the source of Ext.app.Controller you’ll see the getters created in the constructor.

    FV.controller.Articles inherent from your controller class but it has its own models and stores properties which will override the ones in your own base class. This is very much the same way as if your component has height config, it will override that of all base classes (unless the base class forces such config by overriding it in the constructor or initComponent, this is not the case with controller that uses simple config properties).

    If you want this to work the class that inherent from your controller will have to explicitly merge the base class config with its new ones. Again, same like with components.

    Alternatively (and probably a better solution), instead of defining your shared models and stores as config properties in your base class, you could merge these into the config the constructor gets. Something like this in the constructor of your base controller class:

    Ext.merge( config, {
        models: ['Shared'],
        stores: ['Shared']
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to create a HelloWorld App that will update a text field with
I tryed to create new components from one base Windows Form, also I found
I tried to create a script which reads values (name, date, etc) from a
I tried to create a package using some functions and scripts I created (using
I tried to create this by following the video at http://www.asp.net/learn/videos/video-7026.aspx where Joe Stagner
I tried to create a Style for DataGridTextColumn with the following code <Style TargetType={x:Type
I tried to create a file using Oracle UTL_FILE.FOPEN command but i get this
I tried to create a new Swing GUI desktop application template using NetBean 7.0
I have tried to create a jsFiddle of this, but it doesn't work to
Have anybody ever tried to create thumbnails/previews of MS Office files? I do not

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.