responsive.rebuild()

Since: Responsive 1.0.4

Recalculate the column breakpoints based on the class information of the column header cells. Please note - this property requires the Responsive extension for DataTables.

Description

It can be useful to be able to control the column breakpoint information that Responsive responds to after a DataTable has been initialised. For example you may wish to provide user control over which columns are visible. This can be done using code that will add or remove the class never (the other classes can also be used) and then calling this method.

You will also likely wish to immediately call responsive.recalc() to have Responsive update the display for the change in classes. Having this as a separate call allows multiple changes to be drawn at the same time to help improve performance.

Type

function responsive.rebuild()

Description:

Recalculate the column breakpoints based on the class information of the column header cells

Returns:

DataTables API instance

Example

Hide a column completely by adding a class name and rebuilding:

var table = $('#example').DataTable();

$( table.column( 2 ).header() ).addClass( 'never' );

table.responsive.rebuild();
table.responsive.recalc();