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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:49:25+00:00 2026-06-04T20:49:25+00:00

I have a ProjectsController like: Ext.define(‘SimpleTodo.controller.ProjectsController’, { extend: ‘Ext.app.Controller’, refs: [ { ref: ‘addProjectPanel’,

  • 0

I have a ProjectsController like:

Ext.define('SimpleTodo.controller.ProjectsController', {
    extend: 'Ext.app.Controller',
    refs: [
        { ref: 'addProjectPanel', selector: '#addProjectPanel' }
    ],
    init: function() {
        this.control({
            'button[action=addProject]': {
                click: this.addProject
            }
        });
    },
    addProject: function() {
        var form = this.getAddProjectPanel().getForm();
        if (form.isValid()) {
            var projectsStore = Ext.data.StoreManager.lookup('projects'); // Am getting null here
            projectsStore.add(form.getFieldValues());
            projectsStore.sync();
        } else {
            Ext.Msg.alert('INVALID!');
        }
    }
});

I believe the problem is because the store has not been initialized yet? How then should I modify my code? My store is defined like:

Ext.define('SimpleTodo.store.Projects', {
    extend: 'Ext.data.Store',
    requires: [
        'SimpleTodo.model.Project'
    ],
    model: 'SimpleTodo.model.Project',
    storeId: 'projects'    
});

I encounted the same problem when trying to load my store, thus populating my Gridview/Table. I fixed it by moving the function to launch, wonder if thats the right way? In the docs, init is used

Ext.define('SimpleTodo.controller.SidebarController', {
    extend: 'Ext.app.Controller',
    ...
    launch: function() {
        var projectsStore = Ext.data.StoreManager.lookup('projects');
        projectsStore.load();
    },
  • 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-04T20:49:28+00:00Added an answer on June 4, 2026 at 8:49 pm

    Add

    stores:
    [
      'Projects'
    ],
    

    to controller code and then you can use

    getProjectsStore();
    

    to refer to.
    Have a look at http://docs.sencha.com/ext-js/4-0/#!/guide/mvc_pt3, 1. Getting References

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

Sidebar

Related Questions

I have a controller called ProjectsController . Its actions, by default, look for views
have a php code like this,going to convert it in to C#. function isValid($n){
Have one Doubt In MVC Architecture we can able to pass data from Controller
I have a bit of an odd issue. I have a projects controller where
I'm running into an error with T4MVC and named parameters. I have a controller:
I have the following rspec code: require 'spec_helper' require 'mocha' require 'rr' describe ProjectsController,
I have form which is built like this: <%= form_for @location do |f| %>
I use params in my controller like this: class ProductsController < ApplicationController def create
I have a controller named Projects. When I click on a button on the
Suppose I have this simple app working : # model class Project has_many :numbers

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.