REQ: Highlight filtered text plug-in?

REQ: Highlight filtered text plug-in?

fbasfbas Posts: 1,094Questions: 4Answers: 0
edited July 2011 in General
Is there a plug-in to highlight filtered text? If not, I may write one.

I have 3 filtering places in my app: one is the standard search filter across most columns, another is a set of per-column filters using fnFilter, and the last is a MySQL FullText keyword search textbox. Each of them filters on the data, albeit in different ways or scope.

I'd like to highlight words in the result columns that apply in those three searches, using different colors, etc. (somewhat like http://www.nsftools.com/misc/SearchAndHighlight.htm) Is there a plug-in that does this already?

I imagine the simplest implementation would use spans and inline css to color the highlights with fnRender. fnRender doesn't interfere with Editable, does it?

I've also noticed 2 architectures for plug-ins or extras. Some create jquery functions and are chainable to the datatable call like [code] $('#myDataTable').dataTable().makeEditable(); } [/code] while some are standalone classes like [code] oTable = $('#example').dataTable(); new FixedColumns( oTable ); [/code] Which of these is preferable?

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    This is a discussion from before which considers this kind of thing: http://datatables.net/forums/discussion/2123/filter-post-processing-and-highlighting/p1 . Its not a perfect solution, but it might be a useful starting point. If you do improve on it, let us know!

    Allan
This discussion has been closed.