Adding Datatables File Exports has slowed down page on IE

Adding Datatables File Exports has slowed down page on IE

YoDavishYoDavish Posts: 123Questions: 46Answers: 3

Hello,

I'm basically using this as my example:

https://datatables.net/extensions/buttons/examples/initialisation/export.html

For whatever reason, once I've added the CDN and the buttons, the page I'm working loads incredibly slow on IE v11 around 7 to 10 seconds. Before it would take at most 3 seconds. If I remove the CDN and buttons, its back to normal speed.

Below is CDN and script:

<!-- CSS -->
<link href="./lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" media="screen" href="./datepicker/css/datepicker.css" />
<link rel="stylesheet" type="text/css" href="DataTables/datatables.min.css"/>
<link href="./jquery-ui/jquery-ui.min.css" rel="stylesheet"/>
<link href="./jquery-ui/jquery-ui.structure.min.css" rel="stylesheet"/>
<link href="./jquery-ui/jquery-ui.theme.min.css" rel="stylesheet"/>

<!-- SCRIPTS -->
<script src="./js/jquery-3.3.1.min.js"></script>
<script src="./lib/bootstrap/js/bootstrap.js"></script> 
<script type="text/javascript" src="DataTables/datatables.min.js"></script>
<script src="./jquery-ui/jquery-ui.min.js"></script>

<!-- EXPORTS BUTTONS -->
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>


$('#searchResults').dataTable( {
    "searching": true,
    "pageLength": 25,
    language: {
    'search' : 'Search Contains' 
    },
    dom: 'Bfrtip',
    buttons: [
        'copy', 'csv', 'excel', 'pdf'
    ]
});

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951
    Answer ✓

    Looks like all your other resources are loaded from the local server. Have you tried downloading and placing the buttons code on your server and loading from there?

    Also if you concatenate the JS and CSS files it may help with the speed. You can use the Download Builder to build and download concatenated files.

    Kevin

This discussion has been closed.