Opening all child rows on page load not working with ajax sourced data.
Opening all child rows on page load not working with ajax sourced data.
Ramya.a
Posts: 3Questions: 1Answers: 0
Hi,
I am trying to keep all the child rows opened on page load. The code worked well with the HTML sourced data but it stopped working when the data was sourced from ajax.
The link for my code is https://jsfiddle.net/Ramya_a/tv64hc0f/4/ .
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Your example seems to be working when clicking the "Expand All" and "Collapse All" buttons. Please let us know how to recreate the issue.
Kevin
I want all the child rows to be expanded on load.
Sorry, missed the on load part. Since ajax is an async process you need to delay the function that opens all the rows until the Datatable is complete. You can do this in the
initComplete
option. Like this:https://jsfiddle.net/cfobp4gk/
Kevin
Thank you Kevin it worked!