Get JSON

Get JSON

miguelaupmiguelaup Posts: 3Questions: 2Answers: 1

Is possible to get the JSON of filtered rows in a datatable?

I have this to return all selected rows:

$("#status").dataTable()._('tr', {"filter":"applied"})

but I need the data in a JSON format in order to use the data for other components. Is possible to get the data in JSON?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,889Questions: 1Answers: 10,530 Site admin
    Answer ✓
    $('#status').DataTable().rows( { search: 'applied' } ).data().toArray();
    

    Note the use of the 1.10 API rather than the legacy methods.

    Allan

This discussion has been closed.