Download concatenate options does not seem to work as expected any longer

Download concatenate options does not seem to work as expected any longer

glendersonglenderson Posts: 231Questions: 11Answers: 29

I have always downloaded the datatables.js and the extensions as separate files. It now appears that regardless of whether concatenate is selected or not and extensions are selected, I'm getting the datatables.js as a concatenated file. Only when I select just datatables.js without extensions do I get just datatables.js. The end result is a datatables.js in the 4.5M range, with every open loaded on every table in my application. They all seem to initialize automatically in this mode so I can no longer turn on (or off) just the ones I would like.

The solution was to download datatables.js all by itself, no extensions, but it then ignores the styling question and you get all the css styling types. Again, the solution was to ignore them, and grab only the datatables.js files.

Just wanted you to be aware.

Also does not work with IE11 at all, the tabs are not selectable.. I was using Chrome.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin

    The concat option doesn't actually effect what is downloaded. It effects what is displayed on the download page showing you what files to include. For example, if you select DataTables and Buttons, and disable the concat option:

    <link rel="stylesheet" type="text/css" href="DataTables-1.10.16/css/jquery.dataTables.min.css"/>
    <link rel="stylesheet" type="text/css" href="Buttons-1.5.1/css/buttons.dataTables.min.css"/>
     
    <script type="text/javascript" src="DataTables-1.10.16/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="Buttons-1.5.1/js/dataTables.buttons.min.js"></script>
    

    It will still include the concat file in the download - mainly because it was much easier to develop that way(!) but also so you can switch between them easily if you need.

    Allan

  • glendersonglenderson Posts: 231Questions: 11Answers: 29

    Hi Allen, I don't think I was clear then in my explanation.

    datatables is being concatenated regardless of what option you chose if you include extensions.

    If I select datatables and all extensions, no concate, it comes as a 4.5 Meg file instead of the 420K file that is should be. The 420 K, non concatenated version, is not included in the download.

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin

    Do you mean the datatables.js file in the root directory of the generated downloaded zip? If so, then yes, that will always be a concat file that contains all of the Javascript that was selected.

    If you want to include the individual libraries, you need to include them as the HTML <script> tags that the download builder shows. The 450KB file (which is just jquery.dataTables.js on its own) is in the DataTables-1.10.16/js directory.

    Allan

  • glendersonglenderson Posts: 231Questions: 11Answers: 29

    I chose all extensions, no concate. I expect all the extensions in their folders, and a "small" version of datatables.js, .css. Extensions are present.

    Step 1 - Datatables
    Step 2 - Datatables
    Extensions - All
    Step 3 - Minify only

    Download files ....

    In the downloadable.zip file, there is no js directory. There is only the "large" concate version at the root of the datatables.js / .css.

    Missing are the "small" datatables .js, and .css files.

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Answer ✓

    They are in their individual directories such as AutoFull-2.2.2/js. As I stated, the datatables.js file is always made up of all the selected modules concatenated together, regardless of the options.

    If you want only the DataTables JS file, it would be in DataTables-1.10.16/js. Likewise for the extensions.

    Perhaps I've not done well explaining above, but the Concatenate does not effect what is downloaded. This is intentional and correct.

    The Concatenate option effects the HTML that is shown on the download page showing what to include.

    e.g.:

    Concatenate enabled:

    <link rel="stylesheet" type="text/css" href="DataTables/datatables.min.css"/>
     
    <script type="text/javascript" src="DataTables/datatables.min.js"></script>
    

    Concatenate disabled:

    <link rel="stylesheet" type="text/css" href="DataTables-1.10.16/css/jquery.dataTables.min.css"/>
    <link rel="stylesheet" type="text/css" href="AutoFill-2.2.2/css/autoFill.dataTables.css"/>
    <link rel="stylesheet" type="text/css" href="Buttons-1.5.1/css/buttons.dataTables.min.css"/>
     
    <script type="text/javascript" src="DataTables-1.10.16/js/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="AutoFill-2.2.2/js/dataTables.autoFill.min.js"></script>
    <script type="text/javascript" src="Buttons-1.5.1/js/dataTables.buttons.min.js"></script>
    

    Notice that they are not including the same files, even although both files are present in the download.

    Allan

  • glendersonglenderson Posts: 231Questions: 11Answers: 29

    Silly me ... I didn't recognize the separate folder called DataTables-1.10.16 within the downloads. Sorry.

This discussion has been closed.