Datatables Wordpress Media Library Conflict

Datatables Wordpress Media Library Conflict

mav2287mav2287 Posts: 4Questions: 0Answers: 0

I am running in a very odd and strange conflict that had be scratching a dent in my head. I have been using DataTables in wodpress plugins for sometime now and have never had any issues. I then tried to use the wordpress media library and data tables on the same page. Here is the interesting part... if I have all the script on the page but don't ever call .DataTable() there is not problem. The second I actually call .DataTable() it breaks the pop up media library and I see a "TypeError: undefined is not an object (evaluating 'n.replace')" coming from underscore.js. Anyone have an advice on this one?

Replies

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Not a clue I'm afraid. We'd really need a link to a page showing the issue.

    My guess is that jQuery is being loaded multiple times perhaps?

    Allan

  • mav2287mav2287 Posts: 4Questions: 0Answers: 0

    Sorry for being so vague it was just hard to reproduce. Turns out the table for the DataTable was missing the closing </tbody> and </table> tags! For some reason that was causing it to break the media library for some odd reason.

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Weird. But good to hear you've got it working now :)

    Allan

This discussion has been closed.