Create tr elements for rows which have not yet had their nodes created.

When using deferRender you might find that under a specific set of circumstances you need the tr element for a row which hasn't yet been drawn. This method can be used to create the nodes for the rows which haven't yet been drawn.

Plug-in code

$.fn.dataTable.Api.register( 'rows().generate()', function () {
    return this.iterator( 'row', function ( context, index ) {
      context.oApi._fnCreateTr( context, index );
    } );
} );


This plug-in is available on the DataTables CDN:


Note that if you are using multiple plug-ins, it is beneficial in terms of performance to combine the plug-ins into a single file and host it on your own server, rather than making multiple requests to the DataTables CDN.

Version control

If you have any ideas for how this plug-in can be improved, or spot anything that is in error, it is available on GitHub and pull requests are very welcome!


// Create nodes for all rows