below is my datatable code,i m getting Uncaught TypeError:Cannot read property 'ext' of undefined
below is my datatable code,i m getting Uncaught TypeError:Cannot read property 'ext' of undefined
prasmow
Posts: 2Questions: 1Answers: 0
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Column Selector</title>
<script type="text/javascript" src="//code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.3.1/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/pdfmake.min.js"></script>
<script type="text/javascript" src="//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/vfs_fonts.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/buttons/1.3.1/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/buttons/1.3.1/js/buttons.colVis.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.3.1/css/buttons.dataTables.min.css">
<script type="text/javascript">
$(document).ready(function()
{
var url = './findAllStoppageReport';
var datatable = $('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"ajax": {
"url" : url
},
"columns": [
{ "data": "tripDate" },
{ "data": "tripId" },
{ "data": "location"},
{ "data": "stopStartTime"},
{ "data": "stopEndTime"},
{ "data": "totalStopTime"}
]
} );
});
</script>
</head>
<body>
<table id="example" class="cell-border" cellspacing="0" width="100%">
<thead>
<tr>
<th>Date</th>
<th>Trip Id</th>
<th>Location</th>
<th>Stop Start Time</th>
<th>Stop End Time</th>
<th>Total Stop Time</th>
</tr>
</thead>
<tbody></tbody>
</table>
</body>
</html>
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
where are your javascript CDNs? jQuery, DataTables, DataTable buttons and so on.
They were being stripped out by the forum since syntax highlighting wasn't being used. I've added it now.
Can you show us what the
./findAllStoppageReport'
script returns please?Can you also copy and paste the error shown in the browser's console. It would be great if you could link to the page showing the issue.
Allan
./findAllStoppageReport' is the url that returns the json,when i removed the
dom: 'Bfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
code it works fine,but whenever i m adding this buttons code it's giving me the error...please help me in this..
Can you show me the JSON that is returning please?
Happy to do so. Give me a link to the page and I'll take a look into the issue.
Allan