DataTables logo DataTables

This site contains the legacy documentation for DataTables v1.9 and earlier for reference only.
DataTables 1.10 is the current release and is now available.
ColVis v1.1.0


The API for ColVis is fairly simple:

Show details
Get the ColVis instance's control button so it can be injected into the DOM
Input parameters: void
Return parameter: ColVis container element for insertion into the DOM.
Code example:
$(document).ready(function() {
	var table = $('#example').DataTable();
	var colvis = new $.fn.dataTable.ColVis( table );

	$( colvis.button() ).insertAfter('');
} );
fnRebuild or rebuild Why two names?
Show details
Reconstruct the list of columns based on the current visibility (if changed by an external process for example) and the column titles. Note that this function is available as both a static method and an instance method, although typically the static one will be used with a table selecting parameter since the ColVis instances are 'hidden' by DataTables (although accessible through ColVis.aoInstances if you do want them).
Input parameters:
  1. object - DataTables instance for the ColVis button to rebuild. This parameter is optional. If nothing is passed in ColVis will rebuild all column lists on the page.
Return parameter: void
Code example:
$(document).ready( function () {
	var oTable = $('#example').dataTable( {
		"sDom": 'C<"clear">lfrtip'
	} );
	oTable.fnSetColumnVis( 2, false );
	ColVis.fnRebuild( oTable );
} );