Debugging datatables not loading

Debugging datatables not loading

rgonsalvesrgonsalves Posts: 2Questions: 0Answers: 0
edited March 2013 in General
On our third Rails project, we're unable to get dataTables loaded and see "Object [object Object] has no method 'dataTable'" in the Chrome console. It works fine in our 2 other apps. I've made sure our table is formatted correctly, and all the required assets are in their correct location. jQuery doesn't seem to be loaded twice (which I gather from reading the forum is often an issue).

There is no public view of the website at this time, so I can't give you a link.

How would I go about figuring out what is going wrong? e.g., is there a breakpoint I could set if to see if some init code is or is not being called?

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    I'd suggest adding `console.log( jQuery.fn.dataTable );` use before you initialise the DataTable. If that is undefined, then either jQuery is being loaded multiples as you indicate, or DataTables isn't being loaded at all.

    Allan
  • rgonsalvesrgonsalves Posts: 2Questions: 0Answers: 0
    I have a feeling it has something to do with requirejs, but can't prove it yet. This is the only project where we use it and it's the only one where datatables won't load.
This discussion has been closed.