Individual column searching, how to remove just one of the search boxes ?

Individual column searching, how to remove just one of the search boxes ?

edrum1edrum1 Posts: 3Questions: 2Answers: 0

In the Individual column searching (text inputs) example, it shows all columns having a text box to put your criteria into. How do you make it so you can remove some of the search boxes. I don't want them all to show up. Thanks.

This question has an accepted answers - jump to answer

Answers

  • bweith1bweith1 Posts: 5Questions: 0Answers: 1
    Answer ✓

    You could do something like this...

    $('#example tfoot th').each( function () {
            var title = $(this).text();
            if (title == 'Some Title') {
                $(this).html( '<input type="text" placeholder="Search '+title+'" />' );        
            }
    } );
    
    
  • edrum1edrum1 Posts: 3Questions: 2Answers: 0

    Works. Thanks.

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    I would add a searchable class to each, then only add the input to the columns that contain that class, or do the opposite with a unsearchable class.

This discussion has been closed.