Highlighting Filter Results

Highlighting Filter Results

knoebiknoebi Posts: 3Questions: 0Answers: 0
edited September 2009 in General
Hello again,

did anybody try to highlight the results like the text search in Firefox or Safarie? Maybe with a background color behind the word.

Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi knoebi,

    Do you mean that if you type 'Ap' into the search box it would highlight 'Ap' in the word 'Apple'? Wow - that's a good one... It would be fairly heavy Javascript I suspect, due to the need to process all of the text in the filter result - you would also need to modify the DOM on the fly to be able to highlight just the 'Ap' (for example Apple). Alternatively you could put a transparent image over the found text, but you would still need to get the position of the target text, which would most likely be done using the DOM injection anyway...

    If you want to go ahead with this, you might find the source from my "Secret" bookmarklet useful: http://www.sprymedia.co.uk/article/Secret

    Regards,
    Allan
  • CHgsdCHgsd Posts: 25Questions: 0Answers: 0
    @knoebi:
    A solution is available here: http://datatables.net/forums/comments.php?DiscussionID=2123&page=1#Comment_12829
This discussion has been closed.