Hi
I have a Web GIS app using ArcGIS API for JS 4.11.
I want to use Datatables in it but I get the following errors on loading the datatables js files:
Error: multipleDefine
Error: scriptError: https://js.arcgis.com/4.11/dojo/jquery.js
Pretty much similar to this guy: https://community.esri.com/thread/217497-fixing-dojos-and-jquery-dependant-libraries-multipledefine-...
Do we have a workaround for this?
Solved! Go to Solution.
I solved it by using it in a separate Require() function instead of loading it at the top with dojo libraries.
require(["https://cdn.datatables.net/v/dt/jq-3.2.1/dt-1.10.16/datatables.js"], function () { $(document).ready(function () { var table = $('#customerTable').DataTable(); }); });
Surprisingly despite of this new require function itself being inside the main require function, where the dojo is loaded, this works somehow.
require(["esri/Map", "esri/views/MapView", "esri/layers/MapImageLayer", "esri/geometry/Point", "esri/geometry/projection", "esri/geometry/SpatialReference", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/Graphic", "esri/layers/GraphicsLayer", "dojo/domReady!"], function (Map, MapView, MapImageLayer, Point, projection, SpatialReference, SimpleMarkerSymbol, SimpleLineSymbol, Graphic, GraphicsLayer) { ... //New Require Function
I solved it by using it in a separate Require() function instead of loading it at the top with dojo libraries.
require(["https://cdn.datatables.net/v/dt/jq-3.2.1/dt-1.10.16/datatables.js"], function () { $(document).ready(function () { var table = $('#customerTable').DataTable(); }); });
Surprisingly despite of this new require function itself being inside the main require function, where the dojo is loaded, this works somehow.
require(["esri/Map", "esri/views/MapView", "esri/layers/MapImageLayer", "esri/geometry/Point", "esri/geometry/projection", "esri/geometry/SpatialReference", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/Graphic", "esri/layers/GraphicsLayer", "dojo/domReady!"], function (Map, MapView, MapImageLayer, Point, projection, SpatialReference, SimpleMarkerSymbol, SimpleLineSymbol, Graphic, GraphicsLayer) { ... //New Require Function