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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:57:35+00:00 2026-06-04T06:57:35+00:00

After having gone back to the ExtJS4 docs and copying in their examples line

  • 0

After having gone back to the ExtJS4 docs and copying in their examples line for line trying to troubleshoot where I could have gone wrong, I am stumped. Sniffing around the issue of initComponent being in an unfortunate order of operations.

The store that is being defined is 1) not populating the field and 2) is said to be undefined after trying to call it from the field listener.

I am defining a store as such in initComponent,

Ext.define('X.view.NewLogWindow', {
extend: 'Ext.window.Window',
xtype:'newlogwindow',
itemId: 'newLogWindow',
width: 300,
height: 140,
modal: true,
title: 'Create Log',
layout: 'fit',
initComponent: function() {

    this.monthStore = Ext.create('Ext.data.Store', {
        fields : [
            {name : 'id', type : 'int'}, {name : 'month', type : 'string'}
        ],
        autoLoad: true,
        data : [
            {"id" : 0, "month" : "January"},
            {"id" : 1, "month" : "February"},
            {"id" : 2, "month" : "March"},
            {"id" : 3, "month" : "April"},
            {"id" : 4, "month" : "May"},
            {"id" : 5, "month" : "June"},
            {"id" : 6, "month" : "July"},
            {"id" : 7, "month" : "August"},
            {"id" : 8, "month" : "September"},
            {"id" : 9, "month" : "October"},
            {"id" : 10, "month" : "November"},
            {"id" : 11, "month" : "December"}
        ]
    });

    var x = 'fixme';

    console.log(this.monthStore);
    console.log(x);


    this.callParent();


}

Then, I am assigning the store to the combobox in the form panel as such:

items: [
    {
        xtype: 'form',
        margin: 10,
        border: false,
        defaults: {allowBlank: false},
        items: [
            {
                xtype: 'combobox',
                fieldLabel: 'Log Month',
                store: this.monthStore,
                queryMode : 'local',
                displayField: 'month',
                valueField: 'id',
                listeners: {blur: function(field)
                {
                    console.log(this.monthStore);
                    console.log(this.x);
                    }

                }
            }
        ]
    }
]

Here are the outputs from my console logging:

constructor NewLogWindow.js:40
fixme NewLogWindow.js:41
undefined NewLogWindow.js:74
undefined NewLogWindow.js:75

Thanks in advance.

  • 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-04T06:57:36+00:00Added an answer on June 4, 2026 at 6:57 am

    Just use the storeId config so you will have a handle on the store, e.g.:

    initComponent: function() {
    
        Ext.create('Ext.data.Store', {
            storeId: 'months',
            fields : [
                {name : 'id', type : 'int'}, {name : 'month', type : 'string'}
            ],
            autoLoad: true,
            data : [
                {"id" : 0, "month" : "January"},
                {"id" : 1, "month" : "February"},
                {"id" : 2, "month" : "March"},
                {"id" : 3, "month" : "April"},
                {"id" : 4, "month" : "May"},
                {"id" : 5, "month" : "June"},
                {"id" : 6, "month" : "July"},
                {"id" : 7, "month" : "August"},
                {"id" : 8, "month" : "September"},
                {"id" : 9, "month" : "October"},
                {"id" : 10, "month" : "November"},
                {"id" : 11, "month" : "December"}
            ]
        });
    
    // etc...
    

    Then you can use store: Ext.StoreManager.lookup('months') to assign it where you want.

    Also realize that initComponent is called after the static data in the component has been processed. I can’t tell where you are running that second block of code above. But you have to create that combo to use the store you created in initComponent after the store is created, i.e. after initComponent is called. You could do something like this in initComponent right after you create the store:

    this.items = [{
        xtype: 'form',
        margin: 10,
        border: false,
        defaults: {allowBlank: false},
        items: [{
            xtype: 'combobox',
            fieldLabel: 'Log Month',
            store: Ext.StoreManager.lookup('months'),
            queryMode : 'local',
            displayField: 'month',
            valueField: 'id',
            listeners: {
                blur: function(field) {
                    console.log(this.monthStore);
                    console.log(this.x);
                }
            }
        }]
    }];
    

    Another thing I do if I have a reference store that could get use by multiple views is to create it in the controller. Then when I create an instance of a view I already have it available and I can just do the StoreManager.lookup call shown above.

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

Sidebar

Related Questions

Has anyone integrated google docs into their iOS app? Having gone through the example
After having worked in MVC for a few months, I'm back in a previously
I'm trying to use MVC for a new project after having been around the
After having some problems with these two linker errors on SO , I have
Having noted this question has gone unanswered after a month, I hope I can
After having a lot of issues with Textmate and Cucumber, I've gone through a
After having written a few helper classes in magento, now i have this problem,
Have a little design issue after having upgraded to iOS 5 and Xcode 4.2
... after having just read http://www.cocoadev.com/index.pl?CocoaInsecurity ... I am curious to know about your
After having had a dev PC HD corrupt, I'm considering the idea of making

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.