mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Merged in sortResetKey enhancement
This commit is contained in:
commit
7a28b694d8
@ -976,6 +976,14 @@
|
||||
</td>
|
||||
<td><a href="example-option-sortreset-sortrestart.html">Example</a></td>
|
||||
</tr>
|
||||
|
||||
<tr id="sortResetKey">
|
||||
<td>sortResetKey</td>
|
||||
<td>String</td>
|
||||
<td>"ctrlKey"</td>
|
||||
<td>The key used to reset sorting on the entire table. Defaults to the control key. The other options are <code>"shiftKey"</code> or <code>"altKey"</code>. Reference: <a class="external" href="https://developer.mozilla.org/en/DOM/MouseEvent">https://developer.mozilla.org/en/DOM/MouseEvent</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr id="sortrestart">
|
||||
<td><span class="permalink">sortRestart</span></td>
|
||||
|
@ -39,9 +39,10 @@
|
||||
cancelSelection : true, // prevent text selection in the header
|
||||
dateFormat : 'mmddyyyy', // other options: "ddmmyyy" or "yyyymmdd"
|
||||
sortMultiSortKey : 'shiftKey', // key used to select additional columns
|
||||
sortResetKey : 'ctrlKey', // key used to remove sorting on a column
|
||||
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
|
||||
serverSideSorting : false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
|
||||
serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
|
||||
|
||||
// sort options
|
||||
headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
|
||||
@ -456,7 +457,6 @@
|
||||
}
|
||||
|
||||
// sort multiple columns
|
||||
/* */
|
||||
function multisort(table) { /*jshint loopfunc:true */
|
||||
var dynamicExp, sortWrapper, col, mx = 0, dir = 0, tc = table.config,
|
||||
sortList = tc.sortList, l = sortList.length, bl = table.tBodies.length,
|
||||
@ -573,7 +573,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;
|
||||
|
Loading…
Reference in New Issue
Block a user