API
This extension has now been retired and replaced with the column visibility module for Buttons. The documentation is retained for legacy reference only. New projects should use Buttons in preference to ColVis.
The API for ColVis is fairly simple:
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). |
Default: | |
Input parameters: |
|
Return parameter: | void |
Code example: |
$(document).ready( function () { var table = $('#example').dataTable( { "sDom": 'C<"clear">lfrtip' } ); table.fnSetColumnVis( 2, false ); $.fn.dataTable.ColVis.fnRebuild( table ); } ); |