We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    Strange, I dont see any errors. Can you try removing columns in the grid, one-by-one, until you can isolate the problem?
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 27519
      • 275 Posts
      Did that but still get the exception.

      Possible options I can think of:

      - Can I turn on some debug info in MODX?
      - Is there a non-compressed version of ext-all.js so I can debug the whole stack?

      EDIT: I found a ext-all-debug.js in manager/assets. I suppose I can rename that, refresh and start debugging this?
        MODx Revolution / MAMP / OS X
        • 28215
        • 4,149 Posts
        Yes, try from there, although I’m not sure if that will help. My process when debugging stuff like this is: simplify and isolate. Take stuff out until you can pinpoint where the error is occurring. Add console.log() calls to see where exactly the breakpoint is happening.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 27519
          • 275 Posts
          Ok, thanks for the help.

          The ext-all.js debug version was not a success.

          It’s a myriad of classes and methods. And everything becomes extremely slow...
            MODx Revolution / MAMP / OS X
            • 27519
            • 275 Posts
            The story continues:

            I put alert()’s all over both suspicious source files and debugged with Chrome Javascript console.

            Result:

            - The properties grid runs ok and initialises completely.
            - The Home panel triggers an exception at the following line of code, towards the end:

            Tariffs.panel.Home.superclass.constructor.call(this,config);

            I’m not sure what this bit does as it then dwindles off into the mists of ExtJs and my debugging comes to a halt. I tried commenting it out and that did away with the exception but also made my Home panel disappear; which I already expected.

            To be thorough, I did the same for the Batcher home panel and compared the various variable contents with each other. I could not see any obvious differences but had to pass on the details as it gets quite complex at that level.

            EDIT: below is the console output for each of the variables contained in that last line of code.

            Tariffs:  
            Object
            home.panel.js:42
            
            Tariffs.panel:  
            Object
            home.panel.js:43
            
            Tariffs.panel.Home:  function (config) {
            //	alert("h1");
                config = config || {};
            //	alert("h2");
                Ext.apply(config,{
                    border: false
                    ,baseCls: 'modx-formpanel'
                    ,items: [{
                        html: '<h2>'+_('tariffs.management')+'</h2>'
                        ,border: false
                        ,cls: 'modx-page-header'
                    },{
                        xtype: 'modx-tabs'
                        ,bodyStyle: 'padding: 10px'
                        ,defaults: { border: false ,autoHeight: true }
                        ,border: true
                        ,activeItem: 0
                        ,hideMode: 'offsets'
                        ,items: [{
                            title: _('tariffs.tariffs_tab')
                            ,items: [{
                                html: '<p>'+_('tariffs.management_desc')+'</p><br />'
                                ,border: false
                            },{
                                xtype: 'tariffs-tree-tariffs'
                                ,preventRender: true
                            }]
            			},{
                            title: _('tariffs.cottages_tab')
                            ,items: [{
                                html: '<p>'+_('tariffs.cottages_management_desc')+'</p><br />'
                                ,border: false
                            },{
                                xtype: 'tariffs-grid-cottages'
                                ,preventRender: true
                            }]
                        }]
            		}]
                });
            //	alert("h3");
            	console.log('Tariffs: ', Tariffs);
            	console.log('Tariffs.panel: ', Tariffs.panel);
            	console.log('Tariffs.panel.Home: ', Tariffs.panel.Home);
            	console.log('Tariffs.panel.Home.superclass: ', Tariffs.panel.Home.superclass);
            	console.log('Tariffs.panel.Home.superclass.constructor: ', Tariffs.panel.Home.superclass.constructor);
            	Tariffs.panel.Home.superclass.constructor.call(this,config);
            //	alert("h4");
            }
            home.panel.js:44
            
            Tariffs.panel.Home.superclass:  
            Object
            constructor: function (A){A=A||{};Ext.applyIf(A,{cls:"modx-panel",title:""});MODx.Panel.superclass.constructor.call(this,A);this.config=A;}
            override: function (E){for(var D in E){this[D]=E[D]}}
            superclass: function (){return D}
            supr: function (){return D}
            __proto__: Object
            home.panel.js:45
            
            Tariffs.panel.Home.superclass.constructor:  function (A){A=A||{};Ext.applyIf(A,{cls:"modx-panel",title:""});MODx.Panel.superclass.constructor.call(this,A);this.config=A;}
            



            @splittingred: would you know of any things I could try at this point? I’m at wits end....




              MODx Revolution / MAMP / OS X
              • 28215
              • 4,149 Posts
              Send me all your JS code in a PM and i’ll take a look tongue
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 27519
                • 275 Posts
                With massive help from Shaun I managed to solve this.

                It appeared that the JS file that defined the grid was not registered.

                Every JS file that defines the UI components for a CMP needs to have its files registered in core/components/YourProject/controllers/mgr/index.php
                  MODx Revolution / MAMP / OS X