Change child(detail) row after AJAX reload, Data-table
Change child(detail) row after AJAX reload, Data-table
umair12k
Posts: 1Questions: 1Answers: 0
I'm following this solution to reopen child rows after reloading the data table.
https://datatables.net/forums/discussion/53712/re-open-collapsed-child-rows-after-ajax-reload
But the problem is if the position of the row is changed or a new row is added, it shows the child row in the same position. What I want is to change the child row position when the parent row position changed. Please let me know if you know the solution or how this will work out.
Answers
If you have a unique id for each row you can do this:
http://live.datatables.net/qolevune/171/edit
I made a couple changes to the example you linked to. It uses
rows().ids()
to get the row IDs to store in thechildRows
array. Then it loops through the array and uses therow-selector
of String ID to get the row to show.You may need to use the
rowId
option is your unique id is notDT_RowId
.Kevin