Skip to content

Commit ceb8f0b

Browse files
committed
Fixed IE error and missing sorting after (clearing) filter
1 parent c83db8d commit ceb8f0b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tablesorter_filter.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@
8181
// Update the table by executing some of tablesorter's triggers
8282
// This will apply any widgets or pagination, if used.
8383
$(table).trigger("update");
84-
$(table).trigger("appendCache");
84+
if (resultRows.length) {
85+
$(table).trigger("appendCache");
86+
// Apply current sorting after restoring rows
87+
$(table).trigger("sorton", [table.config.sortList]);
88+
}
8589

8690
if(table.config.debug) { $.tablesorter.benchmark("Apply filter:", cacheTime); }
8791

@@ -101,6 +105,8 @@
101105

102106
$(table).trigger("update");
103107
$(table).trigger("appendCache");
108+
// Apply current sorting after restoring all rows
109+
$(table).trigger("sorton", [table.config.sortList]);
104110

105111
if(table.config.debug) { $.tablesorter.benchmark("Clear filter:", cacheTime); }
106112

0 commit comments

Comments
 (0)