Getting Dojo and Data Tables to play nice together

Getting Dojo and Data Tables to play nice together

Adrian LemanekAdrian Lemanek Posts: 4Questions: 1Answers: 0
edited November 2016 in Free community support

I am working on a pretty large mapping application here are the following main libraries we are using. I can't change the following:

  • jQuery 1.7.1
  • Dojo 1.10.4
  • ESRI 3.18

Here is what I am trying to use:
* DataTables 1.10 (latest used the builder)
* Select plugin
* Responsive plugin

So here is what I am seeing:
* TRY 1: If I try to include the built/minified (using your builder) DataTables JS/CSS before Dojo is loaded then the first "require" statement in my code gets an error. In the development tools it looks like the global require and the dojo.require objects are not the same. Was thinking DataTables may be using a conflicting require plugin.
* TRY 2: If I try to include DataTables after dojo has loaded all my other dojo components don't load. Thinking a require conflict still. But no errors in the console.
* TRY 3: Removed "Responsive" from the build as I saw other posts that there might be a conflict here but same issues as try 1 and 2.

Also note that I can include newer versions of jquery or build them into DataTables as long as they are ran as "no conflict" so as not to override the 1.7.1 jQuery.

Any help is greatly appreciated.

Thanks,

Adrian

Answers

  • Adrian LemanekAdrian Lemanek Posts: 4Questions: 1Answers: 0

    Ok I figured out a fix. If I comment out the two blocks in the code that do detection of AMD loading and only use the "browser" section then everything is happy.

    I am of course not going to leave this commented out but I will update the detection to detect if dojo is present and default to the "Browser" type loading (not use require or commonJS).

    If there is a better way to fix this let me know. Otherwise I will submit a patch for review with this change tomorrow.

  • allanallan Posts: 63,145Questions: 1Answers: 10,403 Site admin

    Thanks for posting back - I haven't used dojo myself so I can't really comment much about that, but I'm interested to see the change you had to make and see what changes, if any, should be made in DataTables core. As far as I am aware its UMD loader is quite generic.

    Allan

This discussion has been closed.