Datatables css bootstrap 4 Export buttons behaving strange

Datatables css bootstrap 4 Export buttons behaving strange

bohoirupbohoirup Posts: 6Questions: 2Answers: 0
edited September 2018 in Free community support

I have 2 problems using the datatables component

I am using .net core 2 / MVC and the following includes of datatables (NPM)
"datatables.net-bs4": "1.10.19",
"datatables.net-buttons-bs4": "1.5.3",
"datatables.net-responsive-bs4": "2.2.3",

But i have tried with the never versions as well, but as soon as i change the buttons version to "2.2.0", the precompiled .min.css file is not included, and the .css file cannot compile and gives the following compile errors:
Expected closing curly-brace, found 'div'
Unexpected token, found '}'
Unexpected token, found '@-ms-keyframes'
Expected colon, found '.'
Unexpected token, found '@-webkit-keyframes'
Expected colon, found '.'
Unexpected token, found '@-moz-keyframes'
Expected colon, found '.'
Unexpected token, found '@-webkit-keyframes'
Expected semicolon or closing curly-brace, found '0%'
Unexpected token, found '@keyframes'
Expected semicolon or closing curly-~~~~brace, found '0%'


  1. The CSS is not showing the buttons correctly. When i click the export button, the buttons appear like attached image (on top of each other)

2.
When i export a table to Excel from Internet explorer (not edge), no data is in the file, and a warning is giving regarding corrupted data. Chrome is working as expected.

Hope you can help me out

Best regards
Bo

Answers

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    "datatables.net-responsive-bs4": "2.2.3",

    That's wrong. It should be 1.5.3 like the other. There were a few v2 tags introduced to Buttons by mistake and I thought I'd cleaned them up but possibly not that one. Could you change your package.json file to reference 1.5.3 for that package and try installing it again please.

    When i export a table to Excel from Internet explorer (not edge), no data is in the file, and a warning is giving regarding corrupted data

    This is a bug in the current release that is fixed in the source and will be released soon.

    Allan

  • bohoirupbohoirup Posts: 6Questions: 2Answers: 0

    Hi Allan

    Thank you so much for your response. I have tried deleting current folders in wwwroot/lib and changed the buttons to 1.5.3, unfortunately made no difference.

    I am using this for css:
    "wwwroot/lib/datatables.net-bs4/css/dataTables.bootstrap4.css",
    "wwwroot/lib/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css",

    And this for the javascript part:
    "wwwroot/lib/datatables.net/js/jquery.dataTables.min.js",
    //"wwwroot/lib/datatables.net-bs4/js/dataTables.bootstrap4.js",

      "wwwroot/lib/datatables.net-buttons/js/dataTables.buttons.min.js",
      "wwwroot/lib/datatables.net-buttons/js/buttons.html5.min.js",
      "wwwroot/lib/datatables.net-buttons/js/buttons.flash.min.js",
      "wwwroot/lib/datatables.net-buttons/js/buttons.print.min.js",
    

    I have noticed that there are altso javscript files in the "-BS4" folders, shall this be used in anyway? I get som errors when i try to include it in the project.

    Glad to hear the IE problem is a bug, any idea of when it will be released?

    Best regards
    Bo

  • bohoirupbohoirup Posts: 6Questions: 2Answers: 0
    edited September 2018

    Hi Allan, sorry i just realized that it was the responsive and not the buttons you wrote
    :( sorry

    The lowest version i can choose in my package.json file is 2.1.1, and i have tried to change to that, but without any difference to the strange css on the buttons.

    The versions available to me in the package.json file are:
    "datatables.net-bs4": "3.2.2",
    "datatables.net-bs4": "2.1.1",
    "datatables.net-bs4": "1.10.19",

    "datatables.net-buttons-bs4": "2.2.0",
    "datatables.net-buttons-bs4": "1.5.3",
    "datatables.net-buttons-bs4": "1.5.X",

    "datatables.net-responsive-bs4": "2.2.3",
    "datatables.net-responsive-bs4": "2.2.X",
    "datatables.net-responsive-bs4": "2.1.1",

    My includes are the following:
    "wwwroot/lib/datatables.net-bs4/css/dataTables.bootstrap4.css",
    "wwwroot/lib/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css",
    "wwwroot/lib/datatables.net-responsive-bs4/css/responsive.bootstrap4.css",

      "wwwroot/lib/datatables.net/js/jquery.dataTables.min.js",
      "wwwroot/lib/datatables.net-buttons/js/dataTables.buttons.min.js",
      "wwwroot/lib/datatables.net-buttons/js/buttons.html5.min.js",
      "wwwroot/lib/datatables.net-buttons/js/buttons.flash.min.js",
      "wwwroot/lib/datatables.net-buttons/js/buttons.print.min.js",
      "wwwroot/lib/datatables.net-responsive/js/dataTables.responsive.min.js",
    
  • bohoirupbohoirup Posts: 6Questions: 2Answers: 0

    Hi Allan

    Do you have any idea on how to solve this?

    Best regards
    Bo

  • bohoirupbohoirup Posts: 6Questions: 2Answers: 0

    Hi Allan

    I have now done a testscenario away from my project (as I should have done from the start, sorry), and everything seems to be working. I have found the bug in my own project causing the error.

    So thank you for a great product, and sorry for wasting your time. Lesson learned!

    Best regards
    Bo

This discussion has been closed.