jQuery.FilterTable
jQuery.FilterTable copied to clipboard
no way to skip hiding rows
I tried ignoreClass
but the tr
or td
I have the associated class
applied to are still hidden. This seems like an alternate meaning of "ignoring filtering", I also understand your original reasoning for it now (to skip finding a row/cell). Maybe there could be another option specifically to skip hiding, rather than skip finding?
Here's my quick patch, sorry for the code duplication of the actually showing:
--- a/static/sunnywalker-jQuery.FilterTable-8f7979d/jquery.filtertable.js
+++ b/static/sunnywalker-jQuery.FilterTable-8f7979d/jquery.filtertable.js
@@ -167,6 +167,9 @@
// don't filter the contents of these columns
ignoreColumns: [],
+ //never hide elements with this class applied
+ neverHide: '',
+
// use the element with this selector for the filter input field instead of creating one
inputSelector: null,
@@ -258,6 +261,9 @@
if (settings.ignoreClass) {
all_tds = all_tds.not('.' + settings.ignoreClass);
}
+ if (settings.neverHide) {
+ all_tds.filter('.' + settings.neverHide).addClass(settings.highlightClass).closest('tr').show().addClass(settings.visibleClass);
+ }
// highlight (class=alt) only the cells that match the query and show their rows
all_tds.filter(':' + settings.filterExpression + '("' + q + '")').addClass(settings.highlightClass).closest('tr').show().addClass(settings.visibleClass);
}