Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81798

Refresh child row when parent row updated

$
0
0

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');
                }
        } );

Viewing all articles
Browse latest Browse all 81798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>