We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15114
    • 102 Posts
    Hi,

    I try to develop an add-on. I already developed one a few months ago but as I don't remember exactly how to do I'm following the Doodles tutorial : http://rtfm.modx.com/display/revolution20/Developing+an+Extra+in+MODX+Revolution%2C+Part+II

    When I add the grid, nothing is displayed. And if I look in the Chrome's javascript console I get this error :

    Uncaught TypeError: Cannot call method 'request' of undefined

    Apparently it happens in the file ext-all.js, it crash on this line :

    this.proxy.request(Ext.data.Api.actions[e], a,
    Uncaught TypeError: Cannot call method 'request' of undefined
    									c.params, this.reader, this.createCallback(
    											e, a, b), this, c)


    proxy is null but I don't understand why. I try to compare the code of Doodles extra with mine to find something I could have missed but I didn't found what.

    If I disable the grid in the home.panel.js file, the page is displayed correctly.


    Julien
      • 26903
      • 1,336 Posts
      I've seen this before a while ago, if I remember correctly the proxy isn't created because it doesn't have a URL(or thinks it doesn't have one). Try hardwiring your connectors URL for now an see if it works. I think I eventually redeclared the connector URL's in my JS object config to get round this.
        Use MODx, or the cat gets it!
        • 15114
        • 102 Posts
        Hi,

        Sorry for this very late answer, but you were right. In my controller I had

        $this->addJavascript($this->ludesco_partenaires->config['jsUrl'].'/mgr/sections/index.js');


        So the JS code was executed before the URL was defined.

        with

        $this->addLastJavascript($this->ludesco_partenaires->config['jsUrl'].'/mgr/sections/index.js');


        it works


        Thanks

        Julien