Sliding child rows with Responsive extension

Sliding child rows with Responsive extension

ArcanodArcanod Posts: 1Questions: 1Answers: 0

Hi!
I'd like to use sliding child rows just as shown in this blog post: http://datatables.net/blog/2014-10-02
but can't get it to work with the Responsive extension.

Here is the code of my last attempt.

$(document).ready(function() {
    $('#donnees').dataTable( {
        responsive: {
            details: {
                type: 'column',
                target: 'tr',
                renderer: function ( api, rowIdx, columns ) {
                    var data = $.map( columns, function ( col, i ) {
                        return col.hidden ?
                            '<div>'+col.title+' : '+col.data+'</div>':'';
                    } ).join('');

                    return data ?
                        $('<div class="slider"/>').append( data ) :
                        false;
                }
            }
        },
        columnDefs: [{
                className: 'control',
                orderable: false,
                targets:   0
            }],
        order: [ 1, 'asc' ]
    });

    $( '#donnees tr' ).on('click', function () {
        $( this ).find( 'tr.child' ).slideToggle( 'slow' );
    });
});

Thank you for your help, I have run out of ideas.

Answers

  • colincolin Posts: 15,174Questions: 1Answers: 2,589

    For anyone who finds this thread, answer on this thread here.

This discussion has been closed.