DataTables-Hide-Empty-Columns
DataTables-Hide-Empty-Columns copied to clipboard
Hide only if not already hidden
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
Tnx!
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 )