Я пытаюсь использовать dataTable для заполнения своей таблицы, но я получаю следующую ошибку:
"jquery.dataTables.min.js:49 Uncaught TypeError: Cannot read property 'length' of undefined"
Я прочитал много сообщений на эту тему, но не вижу, где я иду не так
Таблица
<table name="timeline" border="0" cellpadding="0" cellspacing="0" class="table table-striped"
id="wayfinderSignageTable" style="width:100%" data-role="datatable" data-info="false">
<thead>
<tr class="CenterHeader">
<th>Wayfinder</th>
<th>Promotion</th>
<th>From</th>
<th>To</th>
<th>RecordID</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
Ajax call
$(document).on("click", "#current_signage_data_modal", function() {
$('#open_current_signage_data_modal').modal('show');
$('#wayfinderSignageTable').DataTable({
ordering: false,
paging: false,
searching: false,
bInfo : false,
responsive: true,
fixedHeader: true,
ajax: 'get_wayfinder_signage.php',
type: 'POST',
columns: [
{ data: 'DisplayName', width: 50 },
{ data: 'Promotion', width: 50 },
{ data: 'RoomFromDate', width: 50 },
{ data: 'RoomToDate', width: 50},
{ data: 'RecordID', width: 50}
],
});
});
Возвращено JSON
[{"RecordID":"104","DisplayName":"Main reception","Promotion":"EXBHX Test 1","RoomFromDate":"20-09-2019","RoomToDate":"30-09-2019"},
{"RecordID":"105","DisplayName":"Main reception","Promotion":"EXBHX Test3","RoomFromDate":"20-09-2019","RoomToDate":"30-09-2019"},
{"RecordID":"106","DisplayName":"Conference centre","Promotion":"EXBHX Test 4","RoomFromDate":"20-09-2019","RoomToDate":"30-09-2019"},
{"RecordID":"107","DisplayName":"Conference centre","Promotion":"EXBHX Test 4","RoomFromDate":"20-09-2019","RoomToDate":"30-09-2019"}]
Заранее большое спасибо за вашу помощь и время.