Problems usign Datatables Download via CDN

Problems usign Datatables Download via CDN

tsunamotsunamo Posts: 12Questions: 1Answers: 0
edited June 2020 in Free community support

Hello,

using the downloader with the CDN option https://datatables.net/download/ I try to only select Bootstrap 3 and if I only select the Minify version I am not displayed anything (I have actively deselected Datatables on the packages). I can only see the expected result if I select Minify and Concatenate.

The second problem, which is more serious, is this:

If I select Bootstrap 3 and Datatables on the packages, and then on the CDN I only select Minify, I am shown 2 JS files and one CSS file, my question is, why am I being shown jquery.dataTables.min.js and the code to download the equivalent CSS file is not shown?.

Of course my real-use download is more complex than these two options, but I have noticed that my implementation was missing https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css and I haven't been able to figure out which combination of options, if any, includes that CSS file.

Thank you!

Alvaro

Replies

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    1. If you've deselected DataTables, you might as well get the BS3 files from their CDN, there wouldn't be much point using the DataTables CDN...
    2. You still need the core DataTables library, but the BS3 CSS is in the top file, that's all you need.

    Colin

  • tsunamotsunamo Posts: 12Questions: 1Answers: 0
    edited June 2020

    Hello Colin,

    But I don't understand why I don't get a download like:

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css"/>
    
    <script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap.min.js"></script>
    

    Instead of just:

    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap.min.css"/>
     
    <script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap.min.js"></script>
    

    Why is jquery.dataTables.min.js added and not jquery.dataTables.min.css?.

    In my case, my styling while updating DT was failing because of that file being missing.

    Thank you,

    Alvaro

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    Because you don't need it - see example here: https://datatables.net/examples/styling/bootstrap.html - see the CSS tab beneath the table,

    Colin

  • tsunamotsunamo Posts: 12Questions: 1Answers: 0

    Hello Collin,

    Yes, you are completely right. Sorry for creating the issue and thank you for your work!

    Best regards,

    Alvaro

This discussion has been closed.