One way to child row default show

One way to child row default show

sergio.amssergio.ams Posts: 6Questions: 3Answers: 0

This is one way to show by default a child rows of row.

function format(data){
    // Code for format data
    return 'New data with format';
}

dTable = $('#myDTable').DataTable({
    rowCallback: function(row, data, index){
    var dtApi   = this.api();
    var jqTr    = $(row);
    var dtRow = dtApi.row(row);

    if(!dtRow.child.isShown()){
        dtRow.child(format(dtRow.data())).show();
    }
});

Share this and waiting for feedback for corrections and sugestions.

Replies

  • pforsthoffpforsthoff Posts: 1Questions: 0Answers: 0

    Perfect! Been looking for this for quite some time, tried several things that didnt work as good. Thanks!

This discussion has been closed.