{hero}

row().child.show()

Since: DataTables 1.10

Make the child row(s) of a parent row visible.

Description

This method can be used to make the child rows of a parent row visible at any time. Child rows can be attached using row().child() but do not have to be made immediately visible. This method provides the option of making those child rows which have already been attached visible.

Unlike many of the other methods which manipulate the DataTable, this method does not require draw() to be called for the resulting change to be displayed. The child row(s) are inserted into the table without requiring that DataTables redraw.

Type

function row().child.show()

Description:

Show the child row(s) of a parent row

Returns:

DataTables API instance.

Example

Create detail rows initially, but don't show them until the row is clicked upon:

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

table.rows().every(function () {
	this.child('Row details for row: ' + this.index());
});

$('#example tbody').on('click', 'tr', function () {
	var child = table.row(this).child;

	if (child.isShown()) {
		child.hide();
	}
	else {
		child.show();
	}
});