Message from JavaScript discussions
October 2017
— Thats why it have
"next": null,
"previous": null,
Ordering with this kind of url toohttp://localhost:8401/administrator/channel/?ordering=channel_phone
— I see
— Hmmm, actually
— Try changing "data" in all the columns to "results"
— I did it 😕
— Or change "results" in your response to "data"
—
$(document).ready(function () {
$('#table_channel').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": 'http://localhost:8401/administrator/channel/',
"headers": {
'Authorization': 'JWT ' + window.localStorage.getItem("adapay_secret_token")
},
"type": "GET",
"dataType": 'json'
},
"columns": [
{"results": "channel_code"},
{"results": "channel_name"},
{"results": "channel_phone"},
{"results": "channel_email"},
{"results": "channel_email"}
]
});
});
— This is how its looks like now
— And same error, TypeError: data is undefined
☹️
— Maybe change all "results" to "data"?
— Same error data is undefined