Refresh child row when parent row updated
Refresh child row when parent row updated
penguinol
Posts: 5Questions: 3Answers: 0
in DataTables
Hello, I have a simple datatables editor going and I'm trying to figure out how I can refresh a child row after updating the parent row's data. I assume I need to somehow either re-call/show the child row, but not sure how to do that. Thanks.
var editor = new $.fn.dataTable.Editor( {
"ajax":{
url:"php/table.php",
type:"POST",
data: function ( d ) {
d.is_date_search = $is_date_search;
d.start_date = $start_date;
d.end_date = $end_date;
}
},
table: '#table',
fields: [
{
"name": "patients.patientID",
"type": "hidden"
} ,
{
"label": "atty id",
"name": "patients.atty"
}
]
} );
$('#table tbody').on('click', 'td.details-control', function () {
var tr = $(this).closest('tr');
var row = table.row( tr );
if ( row.child.isShown() ) {
// This row is already open - close it
row.child.hide();
tr.removeClass('shown');
}
else {
// Open this row
row.child( format(row.data()) ).show();
tr.addClass('shown');
}
} );
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You are correct - you'd basically need to do
again. You could do that in a
postEdit
event handler - e.g.:Allan
You're awesome, thanks Allan!