We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34084 ☆ A M B ☆
    • 756 Posts
    Have a data store loading remotely:

    In the calling JS file:
    {
    						xtype: 'fieldset',
    						title: 'Output Chunks',
    						items: [
    							{
    								xtype: 'combo',
    								displayField: 'name',
    								valueField: 'id',
    								width: '90%',
    								forceSelection: true,
    								store: mxCalendars.stores.chunks,
    								mode: 'remote',
    								triggerAction: 'all',
    								fieldLabel: 'Outer wrapper chunk',
    								name: 'categoryid',
    								allowBlank: false
    							}
    						]
    					}
    


    Now in my main config:
    Ext.extend(mxCalendars,Ext.Component,{
        	initComponent: function() {
    			this.stores = {};
        	},
        	page:{},
        	window:{},
        	grid:{},
        	tree:{},
        	panel:{},
        	combo:{},
        	config: {}, 	
    });
    


    So the only other thing I can think of is the needing the this.ajax.on() directives in the init function, any other pointers?

    Cheers [ed. note: charless last edited this post 14 years, 10 months ago.]
      Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
      Visit CharlesMx.com for latest news and status updates.
      • 26903
      • 1,336 Posts
      I've seen this error when the code can't find the URL to use to get the remote data, something like ' ,url: MODx.config.connectors_url+'security/group.php' as an example. where do you set this up?
        Use MODx, or the cat gets it!
        • 34084 ☆ A M B ☆
        • 756 Posts
        It's being set the the controller file header.php before all the other js files are included.

        <script type="text/javascript">
        Ext.onReady(function() {
            mxCalendars.config = {
        		"basePath":"\/var\/www\/sites\/modxrevo\/mxcalendars\/core\/components\/mxcalendars\/"
        		,"corePath":"\/var\/www\/sites\/modxrevo\/mxcalendars\/core\/components\/mxcalendars\/"
        		,"modelPath":"\/var\/www\/sites\/modxrevo\/mxcalendars\/core\/components\/mxcalendars\/model\/"
        		,"processorsPath":"\/var\/www\/sites\/modxrevo\/mxcalendars\/core\/components\/mxcalendars\/processors\/"
        		,"chunksPath":"\/var\/www\/sites\/modxrevo\/mxcalendars\/core\/components\/mxcalendars\/elements\/chunks\/"
        		,"jsUrl":"\/mxcalendars\/assets\/components\/mxcalendars\/js\/"
        		,"cssUrl":"\/mxcalendars\/assets\/components\/mxcalendars\/css\/"
        		,"assetsUrl":"\/mxcalendars\/assets\/components\/mxcalendars\/"
        		,"connectorUrl":"\/mxcalendars\/assets\/components\/mxcalendars\/connector.php"};
        });
        </script>
        


        The same connectorUrl is being used in other parts of the ExtJs code to load data results for all the other CRUD processes.

          Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
          Visit CharlesMx.com for latest news and status updates.
          • 34084 ☆ A M B ☆
          • 756 Posts
          This is also what the data store looks like:

          mxcCore.stores.chunks = new Ext.data.JsonStore({
              root: 'results',
              idProperty: 'id',
              url: mxcCore.config.connectorUrl,
              baseParams: {
              	action: 'stores/chunks' 
              },
              fields: [
                  'id', 'name', 'description'
              ]
          });
            Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
            Visit CharlesMx.com for latest news and status updates.
            • 26903
            • 1,336 Posts
            As a test, just change your code above and hard code the URL, does it work then?
              Use MODx, or the cat gets it!
              • 34084 ☆ A M B ☆
              • 756 Posts
              Yeah, that was the firststep and no change. The error was the same.
                Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                Visit CharlesMx.com for latest news and status updates.
                • 26903
                • 1,336 Posts
                Are you using Chrome to test this?
                  Use MODx, or the cat gets it!
                  • 34084 ☆ A M B ☆
                  • 756 Posts
                  Firefox gives the above error, in Chrome the error message is:

                  Uncaught TypeError: Cannot call method 'request' of undefined
                  Ext.handleErrorext-all.js:7
                  Ext.data.Store.Ext.extend.handleExceptionext-all.js:7
                  Ext.data.Store.Ext.extend.loadext-all.js:7
                  MODx.grid.Grid/manager/min/?f=/manager/assets/modext/core/modx.localization.js,/manager/assets/modext/util/utilities.js,/manager/assets/modext/core/modx.component.js,/manager/assets/modext/widgets/core/modx.panel.js,/manager/assets/modext/widgets/core/modx.tabs.js,/manager/assets/modext/widgets/core/modx.window.js,/manager/assets/modext/widgets/core/modx.tree.js,/manager/assets/modext/widgets/core/modx.combo.js,/manager/assets/modext/widgets/core/modx.grid.js,/manager/assets/modext/widgets/core/modx.console.js,/manager/assets/modext/widgets/core/modx.portal.js:163
                  mxcCore.grid.eventsmxcalendars.grid.js:50
                  createext-all.js:7
                  Ext.Container.Ext.extend.createComponentext-all.js:7
                  Ext.Container.Ext.extend.lookupComponentext-all.js:7
                  Ext.Container.Ext.extend.addext-all.js:7
                  (anonymous function)ext-all.js:7
                  Ext.apply.eachext-base.js:7
                  Ext.Container.Ext.extend.addext-all.js:7
                  Ext.Container.Ext.extend.initComponentext-all.js:7
                  Ext.Panel.Ext.extend.initComponentext-all.js:7
                  Ext.Componentext-all.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  createext-all.js:7
                  Ext.Container.Ext.extend.createComponentext-all.js:7
                  Ext.Container.Ext.extend.lookupComponentext-all.js:7
                  Ext.Container.Ext.extend.addext-all.js:7
                  (anonymous function)ext-all.js:7
                  Ext.apply.eachext-base.js:7
                  Ext.Container.Ext.extend.addext-all.js:7
                  Ext.Container.Ext.extend.initComponentext-all.js:7
                  Ext.Panel.Ext.extend.initComponentext-all.js:7
                  Ext.TabPanel.Ext.extend.initComponentext-all.js:7
                  Ext.Componentext-all.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  MODx.Tabs/manager/min/?f=/manager/assets/modext/core/modx.localization.js,/manager/assets/modext/util/utilities.js,/manager/assets/modext/core/modx.component.js,/manager/assets/modext/widgets/core/modx.panel.js,/manager/assets/modext/widgets/core/modx.tabs.js,/manager/assets/modext/widgets/core/modx.window.js,/manager/assets/modext/widgets/core/modx.tree.js,/manager/assets/modext/widgets/core/modx.combo.js,/manager/assets/modext/widgets/core/modx.grid.js,/manager/assets/modext/widgets/core/modx.console.js,/manager/assets/modext/widgets/core/modx.portal.js:99
                  createext-all.js:7
                  Ext.Container.Ext.extend.createComponentext-all.js:7
                  Ext.Container.Ext.extend.lookupComponentext-all.js:7
                  Ext.Container.Ext.extend.addext-all.js:7
                  (anonymous function)ext-all.js:7
                  Ext.apply.eachext-base.js:7
                  Ext.Container.Ext.extend.addext-all.js:7
                  Ext.Container.Ext.extend.initComponentext-all.js:7
                  Ext.Panel.Ext.extend.initComponentext-all.js:7
                  Ext.Componentext-all.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  Ext.apply.extend.Lext-base.js:7
                  MODx.Panel/manager/min/?f=/manager/assets/modext/core/modx.localization.js,/manager/assets/modext/util/utilities.js,/manager/assets/modext/core/modx.component.js,/manager/assets/modext/widgets/core/modx.panel.js,/manager/assets/modext/widgets/core/modx.tabs.js,/manager/assets/modext/widgets/core/modx.window.js,/manager/assets/modext/widgets/core/modx.tree.js,/manager/assets/modext/widgets/core/modx.combo.js,/manager/assets/modext/widgets/core/modx.grid.js,/manager/assets/modext/widgets/core/modx.console.js,/manager/assets/modext/widgets/core/modx.portal.js:58
                  mxcCore.panel.Homehome.panel.js:50
                  createext-all.js:7
                  Ext.extend.loadmodx.js:72
                  Ext.extend._loadComponents/manager/min/?f=/manager/assets/modext/core/modx.localization.js,/manager/assets/modext/util/utilities.js,/manager/assets/modext/core/modx.component.js,/manager/assets/modext/widgets/core/modx.panel.js,/manager/assets/modext/widgets/core/modx.tabs.js,/manager/assets/modext/widgets/core/modx.window.js,/manager/assets/modext/widgets/core/modx.tree.js,/manager/assets/modext/widgets/core/modx.combo.js,/manager/assets/modext/widgets/core/modx.grid.js,/manager/assets/modext/widgets/core/modx.console.js,/manager/assets/modext/widgets/core/modx.portal.js:29
                  MODx.Component/manager/min/?f=/manager/assets/modext/core/modx.localization.js,/manager/assets/modext/util/utilities.js,/manager/assets/modext/core/modx.component.js,/manager/assets/modext/widgets/core/modx.panel.js,/manager/assets/modext/widgets/core/modx.tabs.js,/manager/assets/modext/widgets/core/modx.window.js,/manager/assets/modext/widgets/core/modx.tree.js,/manager/assets/modext/widgets/core/modx.combo.js,/manager/assets/modext/widgets/core/modx.grid.js,/manager/assets/modext/widgets/core/modx.console.js,/manager/assets/modext/widgets/core/modx.portal.js:23
                  mxcCore.page.Homeindex.js:16
                  createext-all.js:7
                  Ext.extend.loadmodx.js:72
                  mxcCore.page.Home.configindex.js:2
                  h.Event.nameext-all.js:7
                  bext-all.js:7
                  
                    Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                    Visit CharlesMx.com for latest news and status updates.
                    • 34084 ☆ A M B ☆
                    • 756 Posts
                    Sorry, the above was from a change I was trying; the same error in Chrome is displayed as in Firefox for the remote JsonStore.

                    Uncaught TypeError: Cannot call method 'request' of undefined
                    Ext.handleErrorext-all.js:7
                    Ext.data.Store.Ext.extend.handleExceptionext-all.js:7
                    Ext.data.Store.Ext.extend.loadext-all.js:7
                    Ext.form.ComboBox.Ext.extend.doQueryext-all.js:11
                    Ext.form.ComboBox.Ext.extend.onTriggerClickext-all.js:11
                    keyNav.Ext.KeyNav.downext-all.js:11
                    Ext.KeyNav.doRelayext-all.js:7
                    keyNav.Ext.KeyNav.doRelayext-all.js:11
                    Ext.KeyNav.relayext-all.js:7
                    Iext-all.js:7
                      Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                      Visit CharlesMx.com for latest news and status updates.
                      • 34084 ☆ A M B ☆
                      • 756 Posts
                      The issue was the store JS file that had all the stores configurations was not loaded in to main mxcCore configuration properly, therefor the actual store was not being loaded as intended.
                        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                        Visit CharlesMx.com for latest news and status updates.