{hero}

rows().remove()

Since: DataTables 1.10

Delete the selected rows from the DataTable.

Description

This method (and its singular counterpart, row().remove()) removes the selected rows from the DataTable completely, deleting the allocated memory for data and nodes from the browser.

Please be aware that this method removes the data from the table internally but that action won't be visually shown until the draw() method is called to update the display. This method can called simply as a chained method of the rows().remove() method's returned object - for example table.rows().remove().draw();. This method is used to reduce the number of draws required if multiple rows are being deleted for optimisation.

Type

function rows().remove()

Description:

Delete the selected rows.

Returns:

DataTables API instance with references for the removed rows in the result set

Examples

Delete all rows with the class selected from the table:

var table = new DataTable('#myTable');

var rows = table
	.rows('.selected')
	.remove()
	.draw();

Remove all rows from a table (this is the same effect as using clear():

var table = new DataTable('#myTable');

var rows = table
	.rows()
	.remove()
	.draw();

Related

The following options are directly related and may also be useful in your application development.