[TYPO3-mvc] How to use jQuery in BE Module?
Alexander Dick
typo3 at dick.at
Thu Feb 9 15:52:48 CET 2012
Hi,
I did it this way:
<f:be.container
addCssFile="{f:uri.resource(path:'Backend/Styles/Common/Style.css')}"
addJsFile="{f:uri.resource(path:'Backend/Scripts/Project.js')}"
>
<script tpye="text/javascript"
src="{f:uri.resource(path:'Backend/Scripts/jquery-1.7.1.min.js')}"></script>
Not the cleanest solution because it gets added at the beginning of the
<body> instead of the <head> but it works.
In my opinion a parameter addJsFiles for specifying an array/object of
files should be introduced, too.
Kind regards
Alex
Am 09.02.2012 15:23, schrieb Stig Nørgaard Færch:
> I'm trying to create a fairly simple ExtBase extension which is
> essentially a database list, with a input form in the FE and and admin
> list in the BE.
>
> I would like to use jQuery in the backend module to create a nice table
> (with dataTables.js) layout.
>
> But how do I include the jQuery libs correctly in the backend?
>
> I use this viewHelper:
> <f:be.container
> pageTitle="foo" enableJumpToUrl="true"
> enableClickMenu="false" loadPrototype="false" loadScriptaculous="false"
> scriptaculousModule="someModule,someOtherModule" loadExtJs="true"
> loadExtJsTheme="false" extJsAdapter="jQuery" enableExtJsDebug="true"
> addCssFile="{f:uri.resource(path:'styles/backend.css')}"
> addJsFile="{f:uri.resource(path:'scripts/main.js')}">
>
> but that doesn't include the jQuery itself, right? (the main.js is
> included correctly)
> and then I also need to include the dataTables.js as well.
>
> I've read something about using:
> $this->response->addAdditionalHeaderData()
> but haven't found out exactly how/where.
>
> Thanks,
>
> /Stig
More information about the TYPO3-project-typo3v4mvc
mailing list