API: Add `rows().generate()` method which can be used to create nodes for rows which haven't yet been created (for use with `-init deferRender`)

pull/384/head
Allan Jardine 7 years ago
parent 71ba75d2f5
commit d3d26e771c

@ -0,0 +1,22 @@
/**
* When using `-init deferRender` you might find that under a specific set of circumstances you
* need the `-tag 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.
*
* @name rows().generate()
* @summary Create tr elements for rows which have not yet had their nodes created.
* @author [Allan Jardine](http://datatables.net)
* @requires DataTables 1.10+
*
* @returns {DataTable.Api} DataTables API instance
*
* @example
* // Create nodes for all rows
* table.rows().generate();
*/
$.fn.dataTable.Api.register( 'rows().generate()', function () {
return this.iterator( 'row', function ( context, index ) {
context.oApi._fnCreateTr( context, index );
} );
} );
Loading…
Cancel
Save