DataTables-Hide-Empty-Columns icon indicating copy to clipboard operation
DataTables-Hide-Empty-Columns copied to clipboard

Hide only if not already hidden

Open ghost opened this issue 6 years ago • 2 comments

Hiya, I found that if I had already hidden a column with other logic, then the plugin made them visible.

So to ignore the columns I had already hidden, I modified the following

	if( api.column( this.index()  ).visible() === true) {
            api.column( this.index() ).visible( isVis )
			}

Might be useful for someone else if it was set up as an option

ghost avatar Mar 14 '18 12:03 ghost

Tnx!

Friends4U avatar Apr 13 '19 22:04 Friends4U

I had the same issue but approached a different way. I only modify the visibility to make it not. not sure which is more efficient, you way or my way. if ( !isVis ) api.column( this.index() ).visible( isVis ) or if ( !isVis ) api.column( this.index() ).visible( false )

alindzon avatar Jul 06 '21 16:07 alindzon