Get original ajax json object for second dataTable

Get original ajax json object for second dataTable

MausinoMausino Posts: 61Questions: 19Answers: 0
edited August 2021 in DataTables 1.10

Hello,
I am getting data via data via ajax from backend //serverside rendering...

Also i output data from DT via drawCallback: function() {window.form_data = this.api().rows().data().toArray();}
But i want also use some my custom fields fileds as in attachments(image).... but callback function will create only array from data: part of json...

Also if i want go around and on load ajax in success

 success: function(data) {
          window.dtData = data;
          console.log(dtData);
          },

This works... that i am getting ajax json object in console ... but dataTables stop working and show no results at all :(

Is some way ??? how will possible ajax object assign to global variable + first DT will work ?.. that i will use this json object in my second DT based on javascript + i will possible use the parts of orig ajax json like custom info from this gloval variable

without that i will must create new ajax call by jquery and

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    edited August 2021 Answer ✓

    The ajax.json() method is what you want.

    Allan

  • MausinoMausino Posts: 61Questions: 19Answers: 0

    Hi, Allan

    Thank you much for for answer... i did not understand why i miss this if i looked on documentation.... maybe because i lost my time with DataSrc: which only manipulate object for dataTable before render... but i wanted impossible from this option

    Here i added some screens for those if will struggling with same thing as i did...

Sign In or Register to comment.