DataTables on custom plugin page
-
Setting define.amd will make it so every script after yours will break. You should load datatables via requirejs instead by adding it to modules in plugin.json
-
@PitaJ , Thank you!
So you mean adding it as follows:
"scripts": [
"static/lib/datatables.js"If so I tried that. Without altering the file, removing the AMD related if, it won't load.
Once I remove the "if amd", deleting it this time, the table works, but other pages have issue loading...
Any idea?
-
@jjsagan no, look at some other plugin.json files. There's a modules object in addition to a scripts array. It works fine with anonymously defined scripts.
-
@jjsagan you don't have to deal with .amd if you use
modules
-
@jjsagan it's literally the whole purpose of that field in plugin.json, but you have to use it like this:
require(['datatables'], function (datatables) { ... });
-
This thread might be of help as well: https://community.nodebb.org/topic/11731/how-to-include-the-images-that-are-referred-from-inside-a-third-party-css/14