[Django]-How to access the ajax response of the datatable outside the datatable in django?

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: [ ... ]
})

Leave a comment