Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions jquery.filtertable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
var jversion = $.fn.jquery.split('.'), jmajor = parseFloat(jversion[0]), jminor = parseFloat(jversion[1]);
if (jmajor<2 && jminor<8) { // build the pseudo selector for jQuery < 1.8
$.expr[':'].filterTableFind = function(a, i, m) { // build the case insensitive filtering functionality as a pseudo-selector expression
return $(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0;
t = $(el).text() + $.map($(el).find('input'), function(element) {
return $(element).val()
}).join(" ");
return t.toUpperCase().indexOf(m[3].toUpperCase())>=0;
};
} else { // build the pseudo selector for jQuery >= 1.8
$.expr[':'].filterTableFind = jQuery.expr.createPseudo(function(arg) {
return function(el) {
return $(el).text().toUpperCase().indexOf(arg.toUpperCase())>=0;
t = $(el).text() + $.map($(el).find('input'), function(element) {
return $(element).val()
}).join(" ");
return t.toUpperCase().indexOf(arg.toUpperCase())>=0;
};
});
}
Expand Down