Add empty td in child rows

Add empty td in child rows

Rodin10Rodin10 Posts: 6Questions: 3Answers: 0

I'm trying to add empty td's to my child rows so that the location of the displayed data changes. My code looks like this:

function format ( d ) {
        return '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
            '<tr>'+
            '<td>'+ d + '</td>'+
            '<td>'+d+'</td>'+
            '</tr>'+
            '</table>';
    }

    $registrationTable.on('click','.fa.fa-angle-double-down',function () {
        var tr = $(this).closest('tr');
        var row = $registrationTable.row( tr );

        if ( row.child.isShown() ) {
            row.child.hide();
            tr.removeClass('shown');
        }
        else {
            row.child([
                $.each(row.data().checkEventDates, function (i, item){
                    row.child(format(item)).show()
                })
                ]
            )
        }
    })

For some reason it doesn't use the format function because it only shows me my data once.

Here is a link to my debug information.

Answers

  • Rodin10Rodin10 Posts: 6Questions: 3Answers: 0

    Deleted the debug information because it had some details that shouldn't be public

This discussion has been closed.