Individual column search boxes confilcting with colvis
Individual column search boxes confilcting with colvis
![karam](https://secure.gravatar.com/avatar/c2be8bf4cd4469d3745f3d006bd83e2f/?default=https%3A%2F%2Fvanillicon.com%2Fc2be8bf4cd4469d3745f3d006bd83e2f_200.png&rating=g&size=120)
I have more than 70 columns and I am using ajax to load data so instead to writing <th> for all I use a for loop but when iam making columns invisible by using colvis the search boxes are not going invisible .
code is here ..
var noofcolumn= $('#example thead th').length;
colmn="";
for(i=0; i<noofcolumn; i++)
{
var title = $('#example thead th').eq( i ).text();
colmn+='<th><input type="text" placeholder="Search" /></th>';
}
$('#example tfoot').html( colmn );
// Apply the search
table.columns().every( function ()
{
$('input', this.footer() ).on( 'keyup change', function () {
table
.column( $(this).parent().index()+':visible' )
.search( this.value )
.draw();
} );
});
This discussion has been closed.