You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to make your component compatible with AjaxManager
danyaPostfactum edited this page Dec 2, 2014
·
1 revision
Move Ext.onReady calls out of javascript files.
Move Ext.onReady, object instantiation, event attaching etc outside of static file. All dynamic code should be added dynamically using $modx->controller->addHtml('<script>....</script>')
In your controllers (or in your plugin), instead of:
If you have var myExtra = new MyExtra() instantiation, move it in your controller too.
Remember, AjaxManager loads js files once upon a browsing session, and then just requests and evaluates scripts chunks, added by controller (via addHtml())
Don't override js object constructors with instances
This is erroneous code.
You should name you constructor as ModExtra (uppercase first letter - this is conventional naming for javascript constructors), and move object instantiation to controller/plugin (see above).
Don't modify window.location directly.
Use MODx.loadPage(action, query) for redirects.
Instead of