Using fnFilter on hidden data

Using fnFilter on hidden data

renbyrdrenbyrd Posts: 7Questions: 0Answers: 0
edited December 2010 in General
My project is going smashingly thanks for DataTables, Alan!

So I've successfully got a drop down select working and the fnFilter applied and tested it out looking for strings. My table of data is information on form submissions and the first column is a small red or yellow dot to designate if the submission was successfully made or failed. What I want my filter to do is to search for rows either with the green (Good) or yellow (Bad) dot in them.

Thus, I need fnFilter to apply to something beside a string. It could be hidden data in the cell. Title, class, etc...

Do you have any suggestions on how to go about doing this?

Replies

  • renbyrdrenbyrd Posts: 7Questions: 0Answers: 0
    Also forgot to mention that I was able to (sorta) do this with some CSS hacks (using display:none), but still curious if there's another way.
  • GerbilGerbil Posts: 3Questions: 0Answers: 0
    Sorry to dredge up this old thread, but I was wondering if there is a better way to do this than the css display:none trick.
  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    Custom filtering sounds like the way to do this: http://datatables.net/development/filtering#row_filters . Using a custom filter you can apply whatever logic you want to a row to tell DataTables to include it in the display or not.

    Allan
  • GerbilGerbil Posts: 3Questions: 0Answers: 0
    Thanks, that's perfect, although the css display:none is actually easier.
This discussion has been closed.