Your rows selector selects every
tr
which is within a
tbody
inside your
SearchGridViewData
element.
The nested grid is within the
tbody
of the outer grid. Therefore, it is matched by the selector.
Try changing the selector to select
tr
elements which are immediate children of the
tbody
instead:
var $rows1 = $('.SearchGridViewData tbody > tr');
There's also no point in using
:nth-child(n)
, since that just selects all children. Using
td
as your selector will have the same effect.
var text1 = $(this).find('td')...
NB: Rather than writing:
return ! ~text1.indexOf(val1) ;
it would be much clearer to write:
return text1.indexOf(val1) !== -1;