TypeError: $.fn.dataTable.colvis is not a constructor

TypeError: $.fn.dataTable.colvis is not a constructor

STKennethSTKenneth Posts: 7Questions: 3Answers: 0
edited May 2016 in Free community support

I did as your answer but It still get same error.

Does it support server-side ?

jQuery(document).ready(function(){
oTable = jQuery("#mytable").DataTable( {
    "dom": 'R<"#titrePlaceholder"><"H"lfr>t<"F"ip>',
    "jQueryUI": true
});
    var colvis = new jQuery.fn.dataTable.ColVis( oTable, {
            "buttonText": "Aff./Cacher Col",
            "exclude": [ 11 ],
            "activate": "mouseover",
            "overlayFade": 1000,
            "restore": "Conf.Initale",
            "showAll": "Affiche tout"
    } );
    jQuery( colvis.button() ).insertAfter('#titrePlaceholder');
});

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    I would very strongly suggest that you use Buttons rather than the legacy ColVis software. Having said that, the error you are getting suggests that the ColVis library has not been loaded.

    Allan

This discussion has been closed.