TYPO3 backend modul DataTable is no function

南笙酒味 提交于 2019-12-02 10:57:45

Well, after struggeling around, i solved my problem with the Typo3 requirejs notation. I think, the jQuery Typo3 noConflict header including will be the problem and i don`t know, why Typo3 uses not her own namespace, for thier methods. But i think, to include all my own/legacy js-librariers over requirejs will be the best practice.

At first, define in your js file (my: BackendModule.js placed in 'EXT:my_extension/Resources/Public/JavaScript') all prerequisites/dependencies, that have to be include:

 define([
'jquery',
'TYPO3/CMS/MyExtension/jquery-ui-widgets',
'moment',
'TYPO3/CMS/MyExtension/jquery.multiselect.min',
'datatables', ], function($, widgets, moment,multiselect) {[YOUR CODE]});

The namespace 'TYPO3/CMS/MyExtension/jquery-ui-widgets' map to the Path: 'EXT:my_extension/Resources/Public/JavaScript/jquery-ui-widgets.js'

After that, i have to include my Js-File in the template:

<f:be.container
        loadExtJsTheme="false"
        enableExtJsDebug="false"
        loadJQuery="false"
        jQueryNamespace="defaultNoConflict"
        includeRequireJsModules="{
            0:'TYPO3/CMS/MyExtension/BackendModule'
        }"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!