Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dataTables fnFilter column on img filename

I'm trying to filter a column, based on the image file name in the src attribute of the tag.

My row looks like this:

<tr class="unread odd">
    <td class=" "><input type="checkbox" name="r28416" value="1"></td>
    <td class=" "><img src="img/icons/bullet_yellow.png" alt="A" title="A"></td>
    <td class="nw ">Non-Lu</td>
    <td class=" "><a class="fancybox" href="tpl/laboratoires/details.php?id=28416">J9121702</a></td>
    <td class=" ">Data</td>
    <td class=" ">378192</td>
    <td class=" ">John Doe</td>
    <td class=" ">DOEJ54161235</td>
    <td class="nw  sorting_1">2012-07-12 12:02</td>
    <td class=" ">0</td>
    <td class=" ">40</td>

I'm using this line as the filter:

table.fnFilter( "bullet_yellow", 1 );

Every other colum works, and I have different filters for other column. Just doesn't work with this one. ANy thoughts?

like image 220
CSSSGatineau Avatar asked Jul 12 '12 16:07

CSSSGatineau


1 Answers

For me it worked when I just added the text to filter for in a span with display:none.

 <td class=" ">
  <img src="img/icons/bullet_yellow.png" alt="A" title="A">
  <span style="display:none;">bullet_yellow</span>`
 </td>
like image 196
haschibaschi Avatar answered Oct 07 '22 13:10

haschibaschi