dataTable在img文件名上的fnFilter列 [英] dataTables fnFilter column on img filename

查看:210
本文介绍了dataTable在img文件名上的fnFilter列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据标签的src属性中的图片文件名过滤列。

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

我的行如下所示:

<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?

推荐答案

对于我来说,当我刚添加了一个 span with display:none

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>

这篇关于dataTable在img文件名上的fnFilter列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆