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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -