Reload table with child rows without flicker

Reload table with child rows without flicker

backseatbackseat Posts: 7Questions: 3Answers: 0

I have a table with some child rows displayed. The table is refreshed periodically via Ajax. The child expansion on the table draw is handled with:

createdRow: function( row, data, dataIndex ) {
    if ( showChildRow ) {
        table.row(row).child( format(data) ).show();
        $(row).addClass( 'shown' );
    }
}

The problem is that the row is initially drawn collapsed, and then almost immediately expanded when the above code executes. That causes a flicker in the display.

What's the best technique for avoiding this? Ideally, I want DataTables to know that the child row should be shown before it starts rendering.

Thanks.

Replies

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Because its an entirely new row you are adding, this is probably expected. Can you link to a page showing the issue though?

    Allan

This discussion has been closed.