Using a combination of plugins causing conflict

Using a combination of plugins causing conflict

astonecipherastonecipher Posts: 1Questions: 1Answers: 0

I am attempting to use dataTables in addition to bootstrap switch for my checkboxes. But, I am only able to use one or the other and am receiving,

".DataTables is not a function"

The intialization is,
$( function() {
$('#example').DataTable();
$.noConflict();
$("[name='action']").bootstrapSwitch();
});

The load order for the files is:
1. JQuery
2. Bootstrap 3
3. DataTables
4. Bootstrap-Switch

Answers

  • johnhanksjohnhanks Posts: 1Questions: 0Answers: 0
    edited December 2015

    I am having the same issue. Using bootstrap slider and carousel and datetimepicker. If I swap order of when I load what js and css files I get sometimes only $(...).DataTables is not a function. or $(...).carousel and $(...).slider or $(...).datetimepicker is not a function.

    jQuery 1.11, jQueryUI 1.10 Bootstrap 3, Datatables, Bootstrap Switch, Bootstrap Datetimepicker

    edit: I moved my loading of css and js files for Datatables after jQuery but before jQueryUI. This fixed my problem. I hope others have similar fixes.

  • florinsecalflorinsecal Posts: 2Questions: 1Answers: 0

    Make sure that the datatables.min.js you use doesn't have jQuery included.

    http://stackoverflow.com/questions/26146866/jquery-datatables-conflict-with-prototype/36576631#36576631

  • allanallan Posts: 61,892Questions: 1Answers: 10,144 Site admin

    Make sure you only load jQuery once on the page.

    If you load it again it will overwrite the previous jQuery and result in this issue.

    Allan

This discussion has been closed.