Posted by & filed under TYPO3.

There are some new functions that load JS libraries:

$this->doc->getPageRenderer()->loadPrototype();
Loads prototype if it wasn’t loaded already
$this->doc->getPageRenderer()->loadScriptaculous();
Loads Scriptaculous, if it wasn’t loaded already
$this->doc->getPageRenderer()->loadScriptaculous('effects,dragdrop');
Loads Scriptaculous with modules
$this->doc->getPageRenderer()->loadExtJS();
Loads ExtJS. This function also accepts two parameters: if first is set to true, ext-all.css will be loaded, if second is set to true, gray theme will be loaded.
If you would like to add ExtJS code to the BE module which has a template class defined (which most BE modules do), you can now add it to an array:
$this->doc->extJsCode[] = …

This code will be inserted into the header section of the page, and wrapped in Ext.onReady(function() { … });

More info:
RFC: #10121: New template-function to add extJS inline code
http://bugs.typo3.org/view.php?id=10121
RFC: #10144: enable JS-Libs in BE
http://bugs.typo3.org/view.php?id=10144

Leave a Reply

  • (will not be published)