From 972621db6e8cb3c0820725c2a41cfedef9fa9fe6 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 1 Aug 2014 11:58:02 -0500 Subject: [PATCH] Core: delay any sort during an update --- js/jquery.tablesorter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index adc6c996..627066c6 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -396,6 +396,7 @@ if ($bk.length && !$bk.hasClass(c.cssInfoBlock)) { // get tbody $tb = ts.processTbody(table, $bk, true); + $tb.children().detach(); // remove rows n = cc[k].normalized; totalRows = n.length; for (i = 0; i < totalRows; i++) { @@ -621,6 +622,10 @@ } function initSort(table, cell, event){ + if (table.isUpdating) { + // let any updates complete before initializing a sort + return setTimeout(function(){ initSort(table, cell, event); }, 50); + } var arry, indx, col, order, s, c = table.config, key = !event[c.sortMultiSortKey],