jquery quicksearch searching also header

289 views Asked by At

I use the modified quicksearch with reset button from this site:

http://michael.theirwinfamily.net/articles/jquery/modify-jquerys-quicksearch-plugin-include-reset-button

This is my code:

<script type="text/javascript">
$(document).ready(function () {
    $('table#MainContent_GV1 tbody tr').quicksearch({
        reset: true,
        resetClass: "resetButton",
        resetLabel: "Reset",
        position: 'before',
        attached: 'table#MainContent_GV1',
        stripeRowClass: ['odd', 'even']
    });
    $(".qs_input").focus();
});

It is working but also searching and hiding the header of the gridview. Other solutions said to add the tr after the tbody to search only the rows but not the header. This is not working because the header is also generated as a row (tr):

enter image description here

how can I exclude the header from the search? Can I set an ID to the header and exclude it somehow with .not or another jquery command? Thanks

Solution:

Found the solution by adding an element in the first row (header):

$('<thead></thead>').prependTo('table#MainContent_GV1').append($('table#MainContent_GV1 tr:first'));

0

There are 0 answers