javascript - how to show and hide columns of using datatable jquery -
i need show , hide columns of datatable after doing javascript test , doesn't work good. test javascript :
if ( $('#commune_to_display').val()==""){ $('#utable td:nth-child(2)').hide(); $('#commune_to ').hide(); }
this test works in first page of datatable , after pagination column still show how can fix it?
you can show/hide columns shown below. replace 3
, 4
actual column indexes.
var table = $('#utable').datatable(); table.column(3).visible(true); // show table.column(4).visible(false); // hide
Comments
Post a Comment