jquery过滤不区分大小写 [英] jquery filtering case insensitive
问题描述
尝试在第一个表格列中按 f 和 F 布尔值。在原始版本中,例子中只有 f ,但是我在行号中添加了 .toLowerCase()
。 17.
但是当您在第二个表格 - 专栏中按 g 或 G 时,我的第一次更新过滤不起作用。我必须改变行号。 18,但我没有任何想法...
您需要将 I found this filtering script: Try to press f and F in first table - column boolean. In original version example was working only with f but I added You need to make the text of the
这篇关于jquery过滤不区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!过滤之前
小写。目前,您只是将过滤器输入的值设为小写。
var criteria = this.value.toLowerCase();
table.find(el).filter(function(_,td){
return $(td).text()。toLowerCase()。indexOf(criteria)== -1 ;
})。parent()。hide();
这是一个更新的小提琴
.toLowerCase()
in line no. 17.
But when you press g or G in second table - column speciality, filtering not working by my first update. I must to change line no. 18, but i dont have any idea...<td>
s lowercase before filtering. Currently you're only making the value of the filter input lowercase.var criteria = this.value.toLowerCase();
table.find(el).filter(function(_, td) {
return $(td).text().toLowerCase().indexOf(criteria) == -1;
}).parent().hide();
Here's an updated fiddle
登录
关闭