I have a jqGrid
in which i need to integrate the search functionality for the complete grid. So the search text must be getting highlighted in the grid(one or many).
I have taken the search text in the grid, but not sure how to highlight the text.
//Code:
$("#btnSearch").click(function () {
var str = $("#txtSearch").val();
if (str) {
var rows = $("#jQGridDemo > tbody > tr:has(td:contains('" + str + "'))");
$.each(rows, function (index, value) {
//Something like this
// $(value).toggleClass('ui-state-highlight');
});
}
});
The value
contains the list of searched text. I have to highlight all those.