user3176053
user3176053

Reputation: 11

On filtering, highlighting searched text in filtered rows in g-grid

I am trying to highlight the searched text in the filtered results of ng-grid. I have implemented custom external filter for filtering. I tried using the 'JavaScript text higlighting jQuery plugin' from

http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html

With this implementation, i am able to highlight the text in the entire div in which ng-grid is placed but it disturbs filtering functionality.

What i am looking is a way to aply filter function directly in the filtered rows so that it will search only the specified column for highlighting not the entire div.

But I'm unable to get it working ... any ideas ?

Thanks

Upvotes: 0

Views: 859

Answers (1)

Yair Tavor
Yair Tavor

Reputation: 2538

When ng-grid generates the columns, it adds classes like 'col0', 'col1' and so on. You can use this to highlight only on the selected column cells

$('#myGridID .col0').highlight('bla');

Upvotes: 0

Related Questions