diff --git a/docs/index.html b/docs/index.html index 8e521079..c9f70687 100644 --- a/docs/index.html +++ b/docs/index.html @@ -968,6 +968,14 @@ Example + + + sortResetKey + String + "ctrlKey" + The key used to reset sorting on the entire table. Defaults to the control key. The other options are "shiftKey" or "altKey". Reference: https://developer.mozilla.org/en/DOM/MouseEvent + + sortRestart diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 3c6c290f..0e6c609b 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -40,6 +40,7 @@ sortMultiSortKey : 'shiftKey', // key used to select additional columns usNumberFormat : true, // false for German "1.234.567,89" or French "1 234 567,89" delayInit : false, // if false, the parsed table contents will not update until the first sort + sortResetKey : 'ctrlKey', // key used to remove sorting on a column // sort options headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc. @@ -568,7 +569,7 @@ // $cell = $(this); k = !e[c.sortMultiSortKey]; // get current column sort order - cell.count = (cell.count + 1) % (c.sortReset ? 3 : 2); + cell.count = e[c.sortResetKey] ? 2 : (cell.count + 1) % (c.sortReset ? 3 : 2); // reset all sorts on non-current column - issue #30 if (c.sortRestart) { i = cell;