fiskrisktisk
fiskrisktisk

Reputation: 158

On jQuery's datatables, how to run a line of code on table rendered

https://www.datatables.net/

I need to run a line of js code after the datatable has rendered, is there an API setting to do that? I tried initComplete and this function gets executed after initialization

Upvotes: 0

Views: 168

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58880

You can use drawCallback option to define a function that is called every time the table is redrawn.

$('#example').dataTable( {
    "drawCallback": function( settings ) {
        alert( 'DataTables has redrawn the table' );
    }
} );

Upvotes: 1

Related Questions