From 9eace4ad62b9bdd12b2381825a89e69928ecf018 Mon Sep 17 00:00:00 2001 From: tborgans Date: Thu, 8 May 2014 16:21:59 +0200 Subject: [PATCH] Update jquery.filtertable.js added new settings 'skipClass' to skip hiding 'tr' if we use nested tables --- jquery.filtertable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.filtertable.js b/jquery.filtertable.js index 8c43476..6d7ddce 100644 --- a/jquery.filtertable.js +++ b/jquery.filtertable.js @@ -40,7 +40,8 @@ quickListClass: 'quick', // class of each quick list item quickListGroupTag: '', // tag surrounding quick list items (e.g., ul) quickListTag: 'a', // tag type of each quick list item (e.g., a or li) - visibleClass: 'visible' // class applied to visible rows + visibleClass: 'visible', // class applied to visible rows + skipClass: 'donothide' // class not to hide if nested tables }, hsc = function(text) { // mimic PHP's htmlspecialchars() function return text.replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); @@ -56,7 +57,7 @@ table.find('tfoot').show(); } } else { // if the filter query is not blank - tbody.find('tr').hide().removeClass(settings.visibleClass); // hide all rows, assuming none were found + tbody.find('tr:not(.'+settings.skipClass+')').hide().removeClass(settings.visibleClass); // hide all rows, assuming none were found if (settings.hideTFootOnFilter) { // hide footer if the setting was specified table.find('tfoot').hide(); }