You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/api/src/rows().generate().ts

34 lines
1.0 KiB
TypeScript

/*! © SpryMedia Ltd - datatables.net/license */
/**
* 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();
*/
import DataTable from 'datatables.net';
declare module 'datatables.net' {
interface ApiRowsMethods<T> {
/** Create tr elements for rows which have not yet had their nodes created. */
generate(): Api<T>;
}
}
DataTable.Api.register('rows().generate()', function () {
return this.iterator('row', function (context, index) {
context.oApi._fnCreateTr(context, index);
});
});