I have a simple search function that I use in the information table, but since I turned the text into a table into editable fields, the search function no longer works.
I tried to fix it in several ways, but I can't get it to work.
Here is what I got so far:
var $rows = $('.list #data'); $('#search').keyup(function() { var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); $rows.show().filter(function() { var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); return !~text.indexOf(val); }).hide(); });
This just works fine in plain text tables. Here's a JSFiddle that shows you what I'm trying to accomplish:
https://jsfiddle.net/je9mc9jp/8/
source share