2👍
✅
Take a look at ajax.dataSrc
. When used as callback you can manipulate the response before it is passed to DataTables, and obviously initialize or populate other elements as well :
myTable = $('#table').DataTable({
ajax: {
type: "GET",
url: "{% url 'Clusters' %}",
dataSrc: function(data) {
doSomethingWith( data.time_data )
return data.data
}
},
columns: [ ... ]
})
Source:stackexchange.com