Tablesorter-空单元格上的过滤器功能 [英] Tablesorter - filter functions on empty cells

查看:88
本文介绍了Tablesorter-空单元格上的过滤器功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Tablesorter 2.7.9(Mottie的叉子)与过滤器功能小部件一起使用,我希望内置的选择下拉列表能够选择空单元格值作为过滤器选项.除了在所有空单元格中放置假值之外,还有谁知道一种简便的方法?我的过滤器下拉列表已经包含2个空白选项:一个用于取消选择过滤器,另一个用于匹配表中的数据值,但是当然将其设置为该值只会取消选择过滤器.

I'm using the tablesorter 2.7.9 (Mottie's fork) with the filter functions widget and I'd like to have the built-in select droplist be able to select empty cell values as a filter option. Does anyone know an easy way to do this aside from putting fake values in all the empty cells? Already my filter droplist contains 2 blank options: one for deselecting the filter and one to match the data value from my table, but of course setting it to this just deselects the filter.

推荐答案

不幸的是,没有一种简单的方法可以通过编写过滤器小部件的方式选择空单元格.主要问题是如何区分清除过滤器和搜索空表单元格?

Sadly there isn't an easy way to select empty cells with the way the filter widget is written. The main problem is how do we differentiate between clearing the filter and searching for empty table cells?

我可以添加一些方法来专门查找空表单元格,或者如您所说,将假"值添加到空表单元格中-一种方法是在空单元格内添加<span style="display:none">{empty}</span>.然后,选择下拉列表将包含{empty}条目,以便用户知道他们正在选择的内容(演示).

I could add some way to specifically find empty table cells, or as you said add "fake" values into the empty table cells - one way is to add <span style="display:none">{empty}</span> inside of empty cells. Then the select dropdown would include an {empty} entry so users know what they are selecting (demo).

对您有用吗?

这篇关于Tablesorter-空单元格上的过滤器功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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