1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-02 14:24:11 +01:00

New: fnSetColumnVis now has the option to cancel the redraw by passing the third parameter to the function as false (default is true).

This commit is contained in:
Allan Jardine 2010-10-30 06:39:48 +01:00
parent 47d5a6781a
commit 4ec3b10e3e

View File

@ -1939,8 +1939,9 @@
* Returns: - * Returns: -
* Inputs: int:iCol - the column whose display should be changed * Inputs: int:iCol - the column whose display should be changed
* bool:bShow - show (true) or hide (false) the column * bool:bShow - show (true) or hide (false) the column
* bool:bRedraw - redraw the table or not - default true
*/ */
this.fnSetColumnVis = function ( iCol, bShow ) this.fnSetColumnVis = function ( iCol, bShow, bRedraw )
{ {
var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] ); var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
var i, iLen; var i, iLen;
@ -2049,8 +2050,12 @@
/* Do a redraw incase anything depending on the table columns needs it /* Do a redraw incase anything depending on the table columns needs it
* (built-in: scrolling) * (built-in: scrolling)
*/ */
if ( typeof bRedraw == 'undefined' || bRedraw )
{
_fnAjustColumnSizing( oSettings ); _fnAjustColumnSizing( oSettings );
_fnDraw( oSettings ); _fnDraw( oSettings );
}
_fnSaveState( oSettings ); _fnSaveState( oSettings );
}; };