Ajax loaded row details

Ajax loaded row details

huertoVerdehuertoVerde Posts: 24Questions: 7Answers: 0

Im trying to implement the code in theis Blog post https://datatables.net/blog/2017-03-31
This code works perfectly. How ever i havent been able to implement it correctly. What kind of data is suposed to be returned in the JSON? a String with all the HTML Code is not it.

My goal ist to add a row with some extra information, extra columns, that is not delivered in the initial Dataset an is called with
AJAX. In the examples form Datatables https://datatables.net/examples/api/row_details.html and https://datatables.net/examples/api/row_details_stateSave.html the data is always delivered at initialisation.

Does Datatable offes this function?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    edited November 2021 Answer ✓

    You are in control of what is displayed in the row details. In all the examples the format() function is used to build the HTML to display the data. The ajax response can be anything you want; JSON, HTML string, etc. The success function is used to build the HTML to display. You will need to update the example code to handle the response, whatever it is, and to build the HTML to display.

    Kevin

Sign In or Register to comment.