[TYPO3-mvc] ExtJS
Xavier Perseguers
typo3 at perseguers.ch
Fri Jul 17 11:10:31 CEST 2009
Hi,
> Xavier Perseguers schrieb:
>> Could be something but actually I would prefer (in my case, not saying
>> your patch is not valuable) something like for BE modules that allows
>> me to "append" ExtJS to headers. Something more "Extbase-integrated",
>> if it's supposed to come. Otherwise your method would be OK (I'll test
>> it if there is no other solution in a few days).
>>
>
> sure, both possible
> $GLOBALS['TSFE']->pageIncludes->loadExtJS();
> $this->doc->pageIncludes->loadExtJS(); or $this->doc->loadExtJS();
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.
--
Xavier Perseguers
http://xavier.perseguers.ch/en
One contribution a day keeps the fork away
More information about the TYPO3-project-typo3v4mvc
mailing list