• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Combobox with Store - cannot read property 'isEmptyStore'

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Combobox with Store - cannot read property 'isEmptyStore'

    I am working in Sencha Architect. I have done this several times successfully. I haven't gotten this error before. I added a Model and a Store to my project. I used the "Test RPG Call" to verify that my JSON call works. I downloaded the Model to a component file directly from Valence. I imported the Model into my Architect project. I created the the Store and I set it to "autoload". When I added my ComboBox and updated it to use my Store, then I get the error. Has anyone else seen this?

    Below is the error from Chrome:

    Uncaught TypeError: Cannot read property 'isEmptyStore' of undefined
    at F.getStoreListeners (ext-all.js:19)
    at F.bindStoreListeners (ext-all.js:19)
    at F.bindStore (ext-all.js:19)
    at F.bindStore (ext-all.js:19)
    at F.initComponent (ext-all.js:19)
    at F.constructor (ext-all.js:19)
    at new F (ext-all.js:19)
    at Object.widget (ext-all.js:19)
    at F.create (ext-all.js:19)
    at F.lookupComponent (ext-all.js:19)

  • #2
    On the store look at the "model" property and make sure your store is linked to the model.

    Comment


    • #3
      It looks like it is linked.

      Ext.define('NOCSTRACE.store.Warehouses', {
      extend: 'Ext.data.Store',

      requires: [
      'NOCSTRACE.model.Warehouse'
      ],

      constructor: function(cfg) {
      var me = this;
      cfg = cfg || {};
      me.callParent([Ext.apply({
      storeId: 'Warehouses',
      autoLoad: true,
      model: 'NOCSTRACE.model.Warehouse'
      }, cfg)]);
      }
      });

      Comment


      • #4
        Here is the model:

        Ext.define('NOCSTRACE.model.Warehouse', {
        extend: 'Ext.data.Model',

        requires: [
        'Ext.data.field.Field',
        'Ext.data.proxy.Ajax',
        'Ext.data.reader.Json'
        ],

        fields: [
        {
        name: 'WHWHSE'
        },
        {
        name: 'WHSHNM'
        }
        ],

        proxy: {
        type: 'ajax',
        extraParams: {
        pgm: 'NOCSTRACE',
        action: 'getWarehouse'
        },
        url: '/valence/vvcall.pgm',
        reader: {
        type: 'json',
        rootProperty: 'warehouses',
        totalProperty: 'totalCount'
        }
        }
        });

        Comment


        • #5
          Let's see the source for your combo box.

          Comment


          • #6
            Here it the combobox:

            {
            xtype: 'combobox',
            itemId: 'warehouse_combo',
            width: 275,
            fieldLabel: 'filegrid_whse',
            hideEmptyLabel: false,
            hideLabel: true,
            editable: false,
            emptyText: 'All Warehouses',
            displayField: 'WHSHNM',
            queryMode: 'local',
            store: 'Warehouses',
            valueField: 'WHWHSE'
            },

            Comment


            • #7
              Check the Application level in the Project Inspector (the very top of the tree) and make sure your model and store are properly listed in the models and stores arrays. If that looks good make sure your entire project is synced up with your server--you could be missing a critical file if you don't sync the whole project.

              Comment


              • #8
                Here is the app.js:
                /* * File: app.js * * This file was generated by Sencha Architect version 4.2.4. * http://www.sencha.com/products/architect/ * * This file requires use of the Ext JS 6.0.x Classic library, under independent license. * License of Sencha Architect does not include license for Ext JS 6.0.x Classic. For more * details see http://www.sencha.com/license or contact license@sencha.com. * * This file will be auto-generated each and everytime you save your project. * * Do NOT hand edit this file. */ // @require @packageOverrides Ext.Loader.setConfig({ }); Ext.application({ models: [ 'Main', 'Warehouse' ], stores: [ 'Main', 'Warehouses' ], views: [ 'Main', 'AddWindow', 'ContextMenu' ], controllers: [ 'Main', 'Window' ], name: 'NOCSTRACE', init: function() { Ext.state.Manager.setProvider(Ext.create('Ext.state.LocalStorageProvider')); }, encodeProperties: function(obj) { var mapObj = { "#":"p", "$":"s", "@":"a" }; Ext.Object.each(obj,function(prop,val){ text = prop; text = text.replace(/#|\$|@/g, function(matched){ return mapObj[matched]; }); if (text !== prop){ delete obj[prop]; obj[text] = val; } }); return obj; }, decodeProperties: function(obj) { var mapObj = { "p":"#", "s":"$", "a":"@" }; Ext.Object.each(obj,function(prop,val){ text = prop; text = text.replace(/p|s|a/g, function(matched){ return mapObj[matched]; }); if (text !== prop){ delete obj[prop]; obj[text] = val; } }); return obj; }, launch: function() { Ext.create('NOCSTRACE.view.Main'); } });

                Comment


                • #9
                  Sorry. Here is a better view: app.js

                  // @require @packageOverrides
                  Ext.Loader.setConfig({

                  });


                  Ext.application({
                  models: [
                  'Main',
                  'Warehouse'
                  ],
                  stores: [
                  'Main',
                  'Warehouses'
                  ],
                  views: [
                  'Main',
                  'AddWindow',
                  'ContextMenu'
                  ],
                  controllers: [
                  'Main',
                  'Window'
                  ],
                  name: 'NOCSTRACE',

                  init: function() {
                  Ext.state.Manager.setProvider(Ext.create('Ext.stat e.LocalStorageProvider'));
                  },

                  encodeProperties: function(obj) {
                  var mapObj = {
                  "#":"p",
                  "$":"s",
                  "@":"a"
                  };
                  Ext.Object.each(obj,function(prop,val){
                  text = prop;
                  text = text.replace(/#|\$|@/g, function(matched){
                  return mapObj[matched];
                  });

                  if (text !== prop){
                  delete obj[prop];
                  obj[text] = val;
                  }
                  });
                  return obj;
                  },

                  decodeProperties: function(obj) {
                  var mapObj = {
                  "p":"#",
                  "s":"$",
                  "a":"@"
                  };
                  Ext.Object.each(obj,function(prop,val){
                  text = prop;
                  text = text.replace(/p|s|a/g, function(matched){
                  return mapObj[matched];
                  });

                  if (text !== prop){
                  delete obj[prop];
                  obj[text] = val;
                  }
                  });
                  return obj;
                  },

                  launch: function() {
                  Ext.create('NOCSTRACE.view.Main');
                  }

                  });

                  Comment


                  • #10
                    I saved my project and uploaded the entire project again. I still have the same message.
                    If I remove the store from the combobox, then there is no error.

                    Comment

                    Working...
                    X