[TYPO3-mvc] ExtJS

Steffen Kamper info at sk-typo3.de
Fri Jul 17 11:58:33 CEST 2009


Hi Xavier,

Xavier Perseguers schrieb:
> Indeed, after applying patches pageinclude_base_v2.diff and 
> pageinclude_for FE_v2.difff from pending patch #11397, this works:
> 
> /**
>  * Index action for this controller.
>  *
>  * @return string The rendered view
>  */
> public function indexAction() {
>     $GLOBALS['TSFE']->pageIncludes->loadExtJS();
>     $GLOBALS['TSFE']->pageIncludes->addJsInlineCode($this->extensionName, "
>         Ext.onReady(function() {
>             Ext.Msg.alert('My Title', 'Hello World!');
>         });
>     ");
> }
> 
> Now I guess something should be made additionally specifically for ExtJS 
> to allow code to be added to the Ext.onReady() method because AFAIK only 
> one call to Ext.onReady is allowed, meaning code above is exclusive with 
> other plugins which would rely on Extbase too.
> 

first: you can use as much Ext.onReady as you like, there is no 
limitation. But good style is to use it once and make a "loader" class 
for your components.

But there is a method for this:
$GLOBALS['TSFE']->pageIncludes->jsFooterInline['ExtOnReady'][] =
'Ext.Msg.alert("My Title", "Hello World!");';

thx for testing!

vg Steffen


More information about the TYPO3-project-typo3v4mvc mailing list