function getChangeTicketInformation() {
var data = [{number: 1, short_description: '1', risk: 1, cmdb_ci_display_value: 1, state: '1', start_date: '1', work_start: '1', work_end: '1'},
{number: 2, short_description: '2', risk: 2, cmdb_ci_display_value: 2, state: '2', start_date: '2', work_start: '2', work_end: '2'},
{number: 3, short_description: '3', risk: 3, cmdb_ci_display_value: 3, state: '3', start_date: '3', work_start: '3', work_end: '3'}];
//$.ajax({
//type: "GET",
//url: "../../get_change_ticket_info",
//success: function (data) {
var dti = $('#changeTicketsTable').DataTable();
$.each(data, function (i, item) {
dti.row.add([
item.number,
item.short_description,
item.risk,
item.cmdb_ci_display_value,
item.state,
item.start_date,
item.work_start,
item.work_end,
'FILL IN'
]).draw(false);
});
//}
//});
}
$('#changeTicketsTable').DataTable({
"pageLength": 5,
'paging': true,
'lengthChange': true,
'searching': false,
'ordering': true,
'info': true,
'autoWidth': false
})
getChangeTicketInformation();
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<script src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<div class="box-body">
<table id="changeTicketsTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>Ticket Number</th>
<th>Description</th>
<th>Risk</th>
<th>Primary CI</th>
<th>State</th>
<th>Planned Start Date</th>
<th>Actual Start Date</th>
<th>Actual End Date</th>
<th>Affected Partners</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<th>Ticket Number</th>
<th>Description</th>
<th>Risk</th>
<th>Primary CI</th>
<th>State</th>
<th>Planned Start Date</th>
<th>Actual Start Date</th>
<th>Actual End Date</th>
<th>Affected Partners</th>
</tr>
</tfoot>
</table>
</div>