jquery-tablesorter 1.19.4 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jquery-tablesorter/version.rb +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +10 -10
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +210 -108
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +151 -74
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +59 -34
- data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +62 -32
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-editable.js +15 -12
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-type-insideRange.js +6 -5
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +53 -28
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +154 -76
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +9 -9
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-print.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sort2Hash.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-staticRow.js +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-view.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb24b3d314deeb03638a037f362320f2f5365f7
|
4
|
+
data.tar.gz: d1c41f726992f0decb2314301175632b19617f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60fdbbd689bac3c8735ff9b1441d79214cc485e813732cd1e6f60c76581b76d81f3fa0d7da3b6deadc851330dc58eb3a5f1b64faf3b70cff61eaf4580e7afca5
|
7
|
+
data.tar.gz: bd7b06f94826a186207e885d70a1967a8a5e652f2bf47ae3c2a00a2bc98ecd7019b00fc11db0310b24bec6f3fa753d914a56be35e7f722990f41b3a2a378c563
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Simple integration of jquery-tablesorter into the asset pipeline.
|
6
6
|
|
7
|
-
Current tablesorter version: 2.
|
7
|
+
Current tablesorter version: 2.25.0 (12/13/2015), [documentation]
|
8
8
|
|
9
9
|
Any issue associated with the js/css files, please report to [Mottie's fork].
|
10
10
|
|
@@ -217,7 +217,7 @@
|
|
217
217
|
$out.find('.ts-startRow, .ts-page').unbind('change' + namespace).bind('change' + namespace, function(){
|
218
218
|
var v = $(this).val(),
|
219
219
|
pg = $(this).hasClass('ts-startRow') ? Math.floor( v / p.size ) + 1 : v;
|
220
|
-
c.$table.
|
220
|
+
c.$table.triggerHandler('pageSet' + namespace, [ pg ]);
|
221
221
|
});
|
222
222
|
}
|
223
223
|
}
|
@@ -227,7 +227,7 @@
|
|
227
227
|
if (c.debug) {
|
228
228
|
console.log('Pager: Triggering pagerComplete');
|
229
229
|
}
|
230
|
-
c.$table.
|
230
|
+
c.$table.triggerHandler('pagerComplete', p);
|
231
231
|
// save pager info to storage
|
232
232
|
if (p.savePages && ts.storage) {
|
233
233
|
ts.storage(table, p.storageKey, {
|
@@ -499,7 +499,7 @@
|
|
499
499
|
if (c.debug) {
|
500
500
|
console.log('Pager: Triggering pagerChange');
|
501
501
|
}
|
502
|
-
$table.
|
502
|
+
$table.triggerHandler( 'pagerChange', p );
|
503
503
|
ts.applyWidget( table );
|
504
504
|
updatePageDisplay(table, p, true);
|
505
505
|
}, 0);
|
@@ -513,7 +513,7 @@
|
|
513
513
|
if (table.config.debug) {
|
514
514
|
console.log('Pager: Triggering pagerInitialized');
|
515
515
|
}
|
516
|
-
$(table).
|
516
|
+
$(table).triggerHandler( 'pagerInitialized', p );
|
517
517
|
ts.applyWidget( table );
|
518
518
|
updatePageDisplay(table, p);
|
519
519
|
}
|
@@ -624,7 +624,7 @@
|
|
624
624
|
if (c.debug) {
|
625
625
|
console.log('Pager: Triggering pagerChange');
|
626
626
|
}
|
627
|
-
$t.
|
627
|
+
$t.triggerHandler( 'pagerChange', p );
|
628
628
|
}
|
629
629
|
if ( !p.removeRows ) {
|
630
630
|
hideRows(table, p);
|
@@ -654,7 +654,7 @@
|
|
654
654
|
if (c.debug) {
|
655
655
|
console.log('Pager: Triggering updateComplete');
|
656
656
|
}
|
657
|
-
$t.
|
657
|
+
$t.triggerHandler('updateComplete', [ table, true ]);
|
658
658
|
}
|
659
659
|
},
|
660
660
|
|
@@ -756,13 +756,13 @@
|
|
756
756
|
if (c.debug) {
|
757
757
|
console.log('Pager: Triggering pageMoved');
|
758
758
|
}
|
759
|
-
$t.
|
759
|
+
$t.triggerHandler('pageMoved', p);
|
760
760
|
ts.applyWidget( table );
|
761
761
|
if (table.isUpdating) {
|
762
762
|
if (c.debug) {
|
763
763
|
console.log('Pager: Triggering updateComplete');
|
764
764
|
}
|
765
|
-
$t.
|
765
|
+
$t.triggerHandler('updateComplete', [ table, true ]);
|
766
766
|
}
|
767
767
|
}
|
768
768
|
},
|
@@ -1059,7 +1059,7 @@
|
|
1059
1059
|
// clear initialized flag
|
1060
1060
|
p.initialized = false;
|
1061
1061
|
// before initialization event
|
1062
|
-
$t.
|
1062
|
+
$t.triggerHandler('pagerBeforeInitialized', p);
|
1063
1063
|
|
1064
1064
|
enablePager(table, p, false);
|
1065
1065
|
if ( typeof p.ajaxUrl === 'string' ) {
|
@@ -1085,7 +1085,7 @@
|
|
1085
1085
|
if (c.debug) {
|
1086
1086
|
console.log('Pager: Triggering pagerInitialized');
|
1087
1087
|
}
|
1088
|
-
c.$table.
|
1088
|
+
c.$table.triggerHandler( 'pagerInitialized', p );
|
1089
1089
|
if ( !( c.widgetOptions.filter_initialized && ts.hasWidget(table, 'filter') ) ) {
|
1090
1090
|
updatePageDisplay(table, p, false);
|
1091
1091
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
5
5
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
6
6
|
*/
|
7
|
-
/*! tablesorter (FORK) - updated
|
7
|
+
/*! tablesorter (FORK) - updated 12-13-2015 (v2.25.0)*/
|
8
8
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
9
9
|
(function(factory) {
|
10
10
|
if (typeof define === 'function' && define.amd) {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
}
|
17
17
|
}(function($) {
|
18
18
|
|
19
|
-
/*! TableSorter (FORK) v2.
|
19
|
+
/*! TableSorter (FORK) v2.25.0 *//*
|
20
20
|
* Client-side table sorting with ease!
|
21
21
|
* @requires jQuery v1.2.6+
|
22
22
|
*
|
@@ -39,7 +39,7 @@
|
|
39
39
|
'use strict';
|
40
40
|
var ts = $.tablesorter = {
|
41
41
|
|
42
|
-
version : '2.
|
42
|
+
version : '2.25.0',
|
43
43
|
|
44
44
|
parsers : [],
|
45
45
|
widgets : [],
|
@@ -80,6 +80,7 @@
|
|
80
80
|
|
81
81
|
emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
|
82
82
|
stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
|
83
|
+
duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
|
83
84
|
textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ){}
|
84
85
|
textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
|
85
86
|
textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
|
@@ -227,7 +228,7 @@
|
|
227
228
|
if ( table.hasInitialized ) {
|
228
229
|
console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
|
229
230
|
} else {
|
230
|
-
console.error( 'Stopping initialization! No table, thead or tbody' );
|
231
|
+
console.error( 'Stopping initialization! No table, thead or tbody', table );
|
231
232
|
}
|
232
233
|
}
|
233
234
|
return;
|
@@ -350,7 +351,7 @@
|
|
350
351
|
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
351
352
|
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
352
353
|
}
|
353
|
-
$table.
|
354
|
+
$table.triggerHandler( 'tablesorter-initialized', table );
|
354
355
|
if ( typeof c.initialized === 'function' ) {
|
355
356
|
c.initialized( table );
|
356
357
|
}
|
@@ -412,7 +413,7 @@
|
|
412
413
|
})
|
413
414
|
.bind( 'applyWidgetId' + namespace, function( e, id ) {
|
414
415
|
e.stopPropagation();
|
415
|
-
ts.
|
416
|
+
ts.applyWidgetId( this, id );
|
416
417
|
})
|
417
418
|
.bind( 'applyWidgets' + namespace, function( e, init ) {
|
418
419
|
e.stopPropagation();
|
@@ -423,6 +424,10 @@
|
|
423
424
|
e.stopPropagation();
|
424
425
|
ts.refreshWidgets( this, all, dontapply );
|
425
426
|
})
|
427
|
+
.bind( 'removeWidget' + namespace, function( e, name, refreshing ) {
|
428
|
+
e.stopPropagation();
|
429
|
+
ts.removeWidget( this, name, refreshing );
|
430
|
+
})
|
426
431
|
.bind( 'destroy' + namespace, function( e, removeClasses, callback ) {
|
427
432
|
e.stopPropagation();
|
428
433
|
ts.destroy( this, removeClasses, callback );
|
@@ -535,6 +540,7 @@
|
|
535
540
|
timer = new Date();
|
536
541
|
}
|
537
542
|
// children tr in tfoot - see issue #196 & #547
|
543
|
+
// don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells
|
538
544
|
c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) );
|
539
545
|
// add icon if cssIcon option exists
|
540
546
|
icon = c.cssIcon ?
|
@@ -574,7 +580,7 @@
|
|
574
580
|
// this may get updated numerous times if there are multiple rows
|
575
581
|
c.sortVars[ column ] = {
|
576
582
|
count : -1, // set to -1 because clicking on the header automatically adds one
|
577
|
-
order: ts.
|
583
|
+
order: ts.getOrder( tmp ) ?
|
578
584
|
[ 1, 0, 2 ] : // desc, asc, unsorted
|
579
585
|
[ 0, 1, 2 ], // asc, desc, unsorted
|
580
586
|
lockedOrder : false
|
@@ -582,7 +588,7 @@
|
|
582
588
|
tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
|
583
589
|
if ( typeof tmp !== 'undefined' && tmp !== false ) {
|
584
590
|
c.sortVars[ column ].lockedOrder = true;
|
585
|
-
c.sortVars[ column ].order = ts.
|
591
|
+
c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1, 1 ] : [ 0, 0, 0 ];
|
586
592
|
}
|
587
593
|
// add cell to headerList
|
588
594
|
c.headerList[ index ] = elem;
|
@@ -705,6 +711,12 @@
|
|
705
711
|
if ( span > 0 ) {
|
706
712
|
colIndex += span;
|
707
713
|
max += span;
|
714
|
+
while ( span + 1 > 0 ) {
|
715
|
+
// set colspan columns to use the same parsers & extractors
|
716
|
+
list.parsers[ colIndex - span ] = parser;
|
717
|
+
list.extractors[ colIndex - span ] = extractor;
|
718
|
+
span--;
|
719
|
+
}
|
708
720
|
}
|
709
721
|
}
|
710
722
|
colIndex++;
|
@@ -847,7 +859,7 @@
|
|
847
859
|
buildCache : function( c, callback, $tbodies ) {
|
848
860
|
var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
|
849
861
|
cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
|
850
|
-
colMax, span, cacheIndex, max, len,
|
862
|
+
colMax, span, cacheIndex, hasParser, max, len, index,
|
851
863
|
table = c.table,
|
852
864
|
parsers = c.parsers;
|
853
865
|
// update tbody variable
|
@@ -922,22 +934,31 @@
|
|
922
934
|
max = c.columns;
|
923
935
|
for ( colIndex = 0; colIndex < max; ++colIndex ) {
|
924
936
|
cell = $row[ 0 ].cells[ colIndex ];
|
925
|
-
if (
|
926
|
-
|
927
|
-
|
937
|
+
if ( cell && cacheIndex < c.columns ) {
|
938
|
+
hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
|
939
|
+
if ( !hasParser && c.debug ) {
|
940
|
+
console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
|
941
|
+
'; cell containing: "' + $(cell).text() + '"; does it have a header?' );
|
928
942
|
}
|
929
|
-
} else if ( cell ) {
|
930
943
|
val = ts.getElementText( c, cell, cacheIndex );
|
931
944
|
rowData.raw[ cacheIndex ] = val; // save original row text
|
945
|
+
// save raw column text even if there is no parser set
|
932
946
|
txt = ts.getParsedText( c, cell, cacheIndex, val );
|
933
947
|
cols[ cacheIndex ] = txt;
|
934
|
-
if ( ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
|
948
|
+
if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
|
935
949
|
// determine column max value (ignore sign)
|
936
950
|
colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
|
937
951
|
}
|
938
952
|
// allow colSpan in tbody
|
939
953
|
span = cell.colSpan - 1;
|
940
954
|
if ( span > 0 ) {
|
955
|
+
index = 0;
|
956
|
+
while ( index <= span ) {
|
957
|
+
// duplicate text (or not) to spanned columns
|
958
|
+
rowData.raw[ cacheIndex + index ] = c.duplicateSpan || index === 0 ? val : '';
|
959
|
+
cols[ cacheIndex + index ] = c.duplicateSpan || index === 0 ? val : '';
|
960
|
+
index++;
|
961
|
+
}
|
941
962
|
cacheIndex += span;
|
942
963
|
max += span;
|
943
964
|
}
|
@@ -957,7 +978,21 @@
|
|
957
978
|
ts.isProcessing( table ); // remove processing icon
|
958
979
|
}
|
959
980
|
if ( c.debug ) {
|
960
|
-
|
981
|
+
len = Math.min( 5, c.cache[ 0 ].normalized.length );
|
982
|
+
console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
|
983
|
+
' rows (showing ' + len + ' rows in log)' + ts.benchmark( cacheTime ) );
|
984
|
+
val = {};
|
985
|
+
for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
|
986
|
+
for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
|
987
|
+
if ( !val[ 'row: ' + cacheIndex ] ) {
|
988
|
+
val[ 'row: ' + cacheIndex ] = {};
|
989
|
+
}
|
990
|
+
val[ 'row: ' + cacheIndex ][ c.$headerIndexed[ colIndex ].text() ] =
|
991
|
+
c.cache[ 0 ].normalized[ cacheIndex ][ colIndex ];
|
992
|
+
}
|
993
|
+
}
|
994
|
+
console[ console.table ? 'table' : 'log' ]( val );
|
995
|
+
if ( console.groupEnd ) { console.groupEnd(); }
|
961
996
|
}
|
962
997
|
if ( $.isFunction( callback ) ) {
|
963
998
|
callback( table );
|
@@ -1053,7 +1088,7 @@
|
|
1053
1088
|
col = parseInt( $el.attr( 'data-column' ), 10 ),
|
1054
1089
|
end = col + c.$headers[ i ].colSpan;
|
1055
1090
|
for ( ; col < end; col++ ) {
|
1056
|
-
include = include ? ts.isValueInArray( col, c.sortList ) > -1 : false;
|
1091
|
+
include = include ? include || ts.isValueInArray( col, c.sortList ) > -1 : false;
|
1057
1092
|
}
|
1058
1093
|
return include;
|
1059
1094
|
});
|
@@ -1158,6 +1193,14 @@
|
|
1158
1193
|
col = parseInt( val[ 0 ], 10 );
|
1159
1194
|
// prevents error if sorton array is wrong
|
1160
1195
|
if ( col < c.columns ) {
|
1196
|
+
|
1197
|
+
// set order if not already defined - due to colspan header without associated header cell
|
1198
|
+
// adding this check prevents a javascript error
|
1199
|
+
if ( !c.sortVars[ col ].order ) {
|
1200
|
+
order = c.sortVars[ col ].order = ts.getOrder( c.sortInitialOrder ) ? [ 1, 0, 2 ] : [ 0, 1, 2 ];
|
1201
|
+
c.sortVars[ col ].count = 0;
|
1202
|
+
}
|
1203
|
+
|
1161
1204
|
order = c.sortVars[ col ].order;
|
1162
1205
|
dir = ( '' + val[ 1 ] ).match( /^(1|d|s|o|n)/ );
|
1163
1206
|
dir = dir ? dir[ 0 ] : '';
|
@@ -1218,6 +1261,12 @@
|
|
1218
1261
|
},
|
1219
1262
|
|
1220
1263
|
updateCell : function( c, cell, resort, callback ) {
|
1264
|
+
if ( ts.isEmptyObject( c.cache ) ) {
|
1265
|
+
// empty table, do an update instead - fixes #1099
|
1266
|
+
ts.updateHeader( c );
|
1267
|
+
ts.commonUpdate( c, resort, callback );
|
1268
|
+
return;
|
1269
|
+
}
|
1221
1270
|
c.table.isUpdating = true;
|
1222
1271
|
c.$table.find( c.selectorRemove ).remove();
|
1223
1272
|
// get position from the dom
|
@@ -1268,6 +1317,11 @@
|
|
1268
1317
|
// problems with element focus
|
1269
1318
|
ts.resortComplete( c, callback );
|
1270
1319
|
}
|
1320
|
+
} else {
|
1321
|
+
if ( c.debug ) {
|
1322
|
+
console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
|
1323
|
+
}
|
1324
|
+
c.table.isUpdating = false;
|
1271
1325
|
}
|
1272
1326
|
},
|
1273
1327
|
|
@@ -1364,7 +1418,7 @@
|
|
1364
1418
|
if ( ts.isEmptyObject( cache ) ) {
|
1365
1419
|
// run pager appender in case the table was just emptied
|
1366
1420
|
return c.appender ? c.appender( table, rows ) :
|
1367
|
-
table.isUpdating ? c.$table.
|
1421
|
+
table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
|
1368
1422
|
}
|
1369
1423
|
if ( c.debug ) {
|
1370
1424
|
appendTime = new Date();
|
@@ -1398,7 +1452,7 @@
|
|
1398
1452
|
ts.applyWidget( table );
|
1399
1453
|
}
|
1400
1454
|
if ( table.isUpdating ) {
|
1401
|
-
c.$table.
|
1455
|
+
c.$table.triggerHandler( 'updateComplete', table );
|
1402
1456
|
}
|
1403
1457
|
},
|
1404
1458
|
|
@@ -1425,6 +1479,7 @@
|
|
1425
1479
|
ts.initSort( c, cell, event );
|
1426
1480
|
}, 50 );
|
1427
1481
|
}
|
1482
|
+
|
1428
1483
|
var arry, indx, headerIndx, dir, temp, tmp, $header,
|
1429
1484
|
notMultiSort = !event[ c.sortMultiSortKey ],
|
1430
1485
|
table = c.table,
|
@@ -1434,7 +1489,7 @@
|
|
1434
1489
|
order = c.sortVars[ col ].order;
|
1435
1490
|
|
1436
1491
|
// Only call sortStart if sorting is enabled
|
1437
|
-
c.$table.
|
1492
|
+
c.$table.triggerHandler( 'sortStart', table );
|
1438
1493
|
// get current column sort order
|
1439
1494
|
c.sortVars[ col ].count =
|
1440
1495
|
event[ c.sortResetKey ] ? 2 : ( c.sortVars[ col ].count + 1 ) % ( c.sortReset ? 3 : 2 );
|
@@ -1545,14 +1600,15 @@
|
|
1545
1600
|
}
|
1546
1601
|
}
|
1547
1602
|
// sortBegin event triggered immediately before the sort
|
1548
|
-
c.$table.
|
1603
|
+
c.$table.triggerHandler( 'sortBegin', table );
|
1549
1604
|
// setTimeout needed so the processing icon shows up
|
1550
1605
|
setTimeout( function() {
|
1551
1606
|
// set css for headers
|
1552
1607
|
ts.setHeadersCss( c );
|
1553
1608
|
ts.multisort( c );
|
1554
1609
|
ts.appendCache( c );
|
1555
|
-
c.$table.
|
1610
|
+
c.$table.triggerHandler( 'sortBeforeEnd', table );
|
1611
|
+
c.$table.triggerHandler( 'sortEnd', table );
|
1556
1612
|
}, 1 );
|
1557
1613
|
},
|
1558
1614
|
|
@@ -1628,7 +1684,7 @@
|
|
1628
1684
|
|
1629
1685
|
resortComplete : function( c, callback ) {
|
1630
1686
|
if ( c.table.isUpdating ) {
|
1631
|
-
c.$table.
|
1687
|
+
c.$table.triggerHandler( 'updateComplete', c.table );
|
1632
1688
|
}
|
1633
1689
|
if ( $.isFunction( callback ) ) {
|
1634
1690
|
callback( c.table );
|
@@ -1660,7 +1716,7 @@
|
|
1660
1716
|
|
1661
1717
|
sortOn : function( c, list, callback, init ) {
|
1662
1718
|
var table = c.table;
|
1663
|
-
c.$table.
|
1719
|
+
c.$table.triggerHandler( 'sortStart', table );
|
1664
1720
|
// update header count index
|
1665
1721
|
ts.updateHeaderSortCount( c, list );
|
1666
1722
|
// set css for headers
|
@@ -1669,11 +1725,12 @@
|
|
1669
1725
|
if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
|
1670
1726
|
ts.buildCache( c );
|
1671
1727
|
}
|
1672
|
-
c.$table.
|
1728
|
+
c.$table.triggerHandler( 'sortBegin', table );
|
1673
1729
|
// sort the table and append it to the dom
|
1674
1730
|
ts.multisort( c );
|
1675
1731
|
ts.appendCache( c, init );
|
1676
|
-
c.$table.
|
1732
|
+
c.$table.triggerHandler( 'sortBeforeEnd', table );
|
1733
|
+
c.$table.triggerHandler( 'sortEnd', table );
|
1677
1734
|
ts.applyWidget( table );
|
1678
1735
|
if ( $.isFunction( callback ) ) {
|
1679
1736
|
callback( table );
|
@@ -1694,7 +1751,7 @@
|
|
1694
1751
|
return ( parsers && parsers[ column ] ) ? parsers[ column ].type || '' : '';
|
1695
1752
|
},
|
1696
1753
|
|
1697
|
-
|
1754
|
+
getOrder : function( val ) {
|
1698
1755
|
// look for 'd' in 'desc' order; return true
|
1699
1756
|
return ( /^d/i.test( val ) || val === 1 );
|
1700
1757
|
},
|
@@ -1854,9 +1911,54 @@
|
|
1854
1911
|
}
|
1855
1912
|
},
|
1856
1913
|
|
1914
|
+
applyWidgetId : function( table, id, init ) {
|
1915
|
+
var applied, time, name,
|
1916
|
+
c = table.config,
|
1917
|
+
wo = c.widgetOptions,
|
1918
|
+
widget = ts.getWidgetById( id );
|
1919
|
+
if ( widget ) {
|
1920
|
+
name = widget.id;
|
1921
|
+
applied = false;
|
1922
|
+
// add widget name to option list so it gets reapplied after sorting, filtering, etc
|
1923
|
+
if ( $.inArray( name, c.widgets ) < 0 ) {
|
1924
|
+
c.widgets.push( name );
|
1925
|
+
}
|
1926
|
+
if ( c.debug ) { time = new Date(); }
|
1927
|
+
|
1928
|
+
if ( init || !( c.widgetInit[ name ] ) ) {
|
1929
|
+
// set init flag first to prevent calling init more than once (e.g. pager)
|
1930
|
+
c.widgetInit[ name ] = true;
|
1931
|
+
if ( table.hasInitialized ) {
|
1932
|
+
// don't reapply widget options on tablesorter init
|
1933
|
+
ts.applyWidgetOptions( table );
|
1934
|
+
}
|
1935
|
+
if ( typeof widget.init === 'function' ) {
|
1936
|
+
applied = true;
|
1937
|
+
if ( c.debug ) {
|
1938
|
+
console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
|
1939
|
+
}
|
1940
|
+
widget.init( table, widget, c, wo );
|
1941
|
+
}
|
1942
|
+
}
|
1943
|
+
if ( !init && typeof widget.format === 'function' ) {
|
1944
|
+
applied = true;
|
1945
|
+
if ( c.debug ) {
|
1946
|
+
console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
|
1947
|
+
}
|
1948
|
+
widget.format( table, c, wo, false );
|
1949
|
+
}
|
1950
|
+
if ( c.debug ) {
|
1951
|
+
if ( applied ) {
|
1952
|
+
console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
|
1953
|
+
if ( console.groupEnd ) { console.groupEnd(); }
|
1954
|
+
}
|
1955
|
+
}
|
1956
|
+
}
|
1957
|
+
},
|
1958
|
+
|
1857
1959
|
applyWidget : function( table, init, callback ) {
|
1858
1960
|
table = $( table )[ 0 ]; // in case this is called externally
|
1859
|
-
var indx, len, names, widget,
|
1961
|
+
var indx, len, names, widget, time,
|
1860
1962
|
c = table.config,
|
1861
1963
|
widgets = [];
|
1862
1964
|
// prevent numerous consecutive widget applications
|
@@ -1895,39 +1997,8 @@
|
|
1895
1997
|
}
|
1896
1998
|
for ( indx = 0; indx < len; indx++ ) {
|
1897
1999
|
widget = widgets[ indx ];
|
1898
|
-
if ( widget ) {
|
1899
|
-
|
1900
|
-
applied = false;
|
1901
|
-
if ( c.debug ) { time2 = new Date(); }
|
1902
|
-
|
1903
|
-
if ( init || !( c.widgetInit[ name ] ) ) {
|
1904
|
-
// set init flag first to prevent calling init more than once (e.g. pager)
|
1905
|
-
c.widgetInit[ name ] = true;
|
1906
|
-
if ( table.hasInitialized ) {
|
1907
|
-
// don't reapply widget options on tablesorter init
|
1908
|
-
ts.applyWidgetOptions( table );
|
1909
|
-
}
|
1910
|
-
if ( typeof widget.init === 'function' ) {
|
1911
|
-
applied = true;
|
1912
|
-
if ( c.debug ) {
|
1913
|
-
console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
|
1914
|
-
}
|
1915
|
-
widget.init( table, widget, table.config, table.config.widgetOptions );
|
1916
|
-
}
|
1917
|
-
}
|
1918
|
-
if ( !init && typeof widget.format === 'function' ) {
|
1919
|
-
applied = true;
|
1920
|
-
if ( c.debug ) {
|
1921
|
-
console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
|
1922
|
-
}
|
1923
|
-
widget.format( table, table.config, table.config.widgetOptions, false );
|
1924
|
-
}
|
1925
|
-
if ( c.debug ) {
|
1926
|
-
if ( applied ) {
|
1927
|
-
console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time2 ) );
|
1928
|
-
if ( console.groupEnd ) { console.groupEnd(); }
|
1929
|
-
}
|
1930
|
-
}
|
2000
|
+
if ( widget && widget.id ) {
|
2001
|
+
ts.applyWidgetId( table, widget.id, init );
|
1931
2002
|
}
|
1932
2003
|
}
|
1933
2004
|
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
@@ -1939,7 +2010,7 @@
|
|
1939
2010
|
c.timerReady = setTimeout( function() {
|
1940
2011
|
table.isApplyingWidgets = false;
|
1941
2012
|
$.data( table, 'lastWidgetApplication', new Date() );
|
1942
|
-
c.$table.
|
2013
|
+
c.$table.triggerHandler( 'tablesorter-ready' );
|
1943
2014
|
}, 10 );
|
1944
2015
|
if ( c.debug ) {
|
1945
2016
|
widget = c.widgets.length;
|
@@ -1995,7 +2066,7 @@
|
|
1995
2066
|
len = widgets.length,
|
1996
2067
|
list = [],
|
1997
2068
|
callback = function( table ) {
|
1998
|
-
$( table ).
|
2069
|
+
$( table ).triggerHandler( 'refreshComplete' );
|
1999
2070
|
};
|
2000
2071
|
// remove widgets not defined in config.widgets, unless doAll is true
|
2001
2072
|
for ( indx = 0; indx < len; indx++ ) {
|
@@ -2084,17 +2155,17 @@
|
|
2084
2155
|
// computeTableHeaderCellIndexes from:
|
2085
2156
|
// http://www.javascripttoolbox.com/lib/table/examples.php
|
2086
2157
|
// http://www.javascripttoolbox.com/temp/table_cellindex.html
|
2087
|
-
computeColumnIndex : function( $rows ) {
|
2088
|
-
var i, j, k, l,
|
2158
|
+
computeColumnIndex : function( $rows, c ) {
|
2159
|
+
var i, j, k, l, cell, cells, rowIndex, rowSpan, colSpan, firstAvailCol,
|
2160
|
+
// total columns has been calculated, use it to set the matrixrow
|
2161
|
+
columns = c && c.columns || 0,
|
2089
2162
|
matrix = [],
|
2090
|
-
matrixrow =
|
2163
|
+
matrixrow = new Array( columns );
|
2091
2164
|
for ( i = 0; i < $rows.length; i++ ) {
|
2092
2165
|
cells = $rows[ i ].cells;
|
2093
2166
|
for ( j = 0; j < cells.length; j++ ) {
|
2094
2167
|
cell = cells[ j ];
|
2095
|
-
$cell = $( cell );
|
2096
2168
|
rowIndex = cell.parentNode.rowIndex;
|
2097
|
-
cellId = rowIndex + '-' + $cell.index();
|
2098
2169
|
rowSpan = cell.rowSpan || 1;
|
2099
2170
|
colSpan = cell.colSpan || 1;
|
2100
2171
|
if ( typeof matrix[ rowIndex ] === 'undefined' ) {
|
@@ -2107,11 +2178,16 @@
|
|
2107
2178
|
break;
|
2108
2179
|
}
|
2109
2180
|
}
|
2110
|
-
//
|
2111
|
-
if ( cell.
|
2181
|
+
// jscs:disable disallowEmptyBlocks
|
2182
|
+
if ( columns && cell.cellIndex === firstAvailCol ) {
|
2183
|
+
// don't to anything
|
2184
|
+
} else if ( cell.setAttribute ) {
|
2185
|
+
// jscs:enable disallowEmptyBlocks
|
2186
|
+
// add data-column (setAttribute = IE8+)
|
2112
2187
|
cell.setAttribute( 'data-column', firstAvailCol );
|
2113
2188
|
} else {
|
2114
|
-
|
2189
|
+
// remove once we drop support for IE7 - 1/12/2016
|
2190
|
+
$( cell ).attr( 'data-column', firstAvailCol );
|
2115
2191
|
}
|
2116
2192
|
for ( k = rowIndex; k < rowIndex + rowSpan; k++ ) {
|
2117
2193
|
if ( typeof matrix[ k ] === 'undefined' ) {
|
@@ -2320,15 +2396,16 @@
|
|
2320
2396
|
$f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
|
2321
2397
|
if ( removeClasses === false && $.inArray( 'uitheme', c.widgets ) >= 0 ) {
|
2322
2398
|
// reapply uitheme classes, in case we want to maintain appearance
|
2323
|
-
$t.
|
2324
|
-
$t.
|
2399
|
+
$t.triggerHandler( 'applyWidgetId', [ 'uitheme' ] );
|
2400
|
+
$t.triggerHandler( 'applyWidgetId', [ 'zebra' ] );
|
2325
2401
|
}
|
2326
2402
|
// remove widget added rows, just in case
|
2327
2403
|
$h.find( 'tr' ).not( $r ).remove();
|
2328
|
-
// disable tablesorter
|
2404
|
+
// disable tablesorter - not using .unbind( namespace ) because namespacing was
|
2405
|
+
// added in jQuery v1.4.3 - see http://api.jquery.com/event.namespace/
|
2329
2406
|
events = 'sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton ' +
|
2330
|
-
'appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave
|
2331
|
-
'sortBegin sortEnd resetToLoadState '.split( ' ' )
|
2407
|
+
'appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave ' +
|
2408
|
+
'keypress sortBegin sortEnd resetToLoadState '.split( ' ' )
|
2332
2409
|
.join( c.namespace + ' ' );
|
2333
2410
|
$t
|
2334
2411
|
.removeData( 'tablesorter' )
|
@@ -3005,7 +3082,7 @@
|
|
3005
3082
|
|
3006
3083
|
})(jQuery);
|
3007
3084
|
|
3008
|
-
/*! Widget: filter - updated
|
3085
|
+
/*! Widget: filter - updated 12/13/2015 (v2.25.0) *//*
|
3009
3086
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
3010
3087
|
* by Rob Garrison
|
3011
3088
|
*/
|
@@ -3215,7 +3292,7 @@
|
|
3215
3292
|
table = c.table,
|
3216
3293
|
parsed = data.parsed[ data.index ],
|
3217
3294
|
query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ),
|
3218
|
-
parser = c.parsers[ data.index ],
|
3295
|
+
parser = c.parsers[ data.index ] || {},
|
3219
3296
|
savedSearch = query;
|
3220
3297
|
// parse filter value in case we're comparing numbers ( dates )
|
3221
3298
|
if ( parsed || parser.type === 'numeric' ) {
|
@@ -3355,6 +3432,7 @@
|
|
3355
3432
|
|
3356
3433
|
var options, string, txt, $header, column, filters, val, fxn, noSelect;
|
3357
3434
|
c.$table.addClass( 'hasFilters' );
|
3435
|
+
c.lastSearch = [];
|
3358
3436
|
|
3359
3437
|
// define timers so using clearTimeout won't cause an undefined error
|
3360
3438
|
wo.filter_searchTimer = null;
|
@@ -3437,7 +3515,7 @@
|
|
3437
3515
|
if ( wo.filter_reset instanceof $ ) {
|
3438
3516
|
// reset contains a jQuery object, bind to it
|
3439
3517
|
wo.filter_reset.click( function() {
|
3440
|
-
c.$table.
|
3518
|
+
c.$table.triggerHandler( 'filterReset' );
|
3441
3519
|
});
|
3442
3520
|
} else if ( $( wo.filter_reset ).length ) {
|
3443
3521
|
// reset is a jQuery selector, use event delegation
|
@@ -3445,7 +3523,7 @@
|
|
3445
3523
|
.undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
|
3446
3524
|
.delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
|
3447
3525
|
// trigger a reset event, so other functions ( filter_formatter ) know when to reset
|
3448
|
-
c.$table.
|
3526
|
+
c.$table.triggerHandler( 'filterReset' );
|
3449
3527
|
});
|
3450
3528
|
}
|
3451
3529
|
}
|
@@ -3547,7 +3625,7 @@
|
|
3547
3625
|
ts.setFilters( table, filters, true );
|
3548
3626
|
}
|
3549
3627
|
}
|
3550
|
-
c.$table.
|
3628
|
+
c.$table.triggerHandler( 'filterFomatterUpdate' );
|
3551
3629
|
// trigger init after setTimeout to prevent multiple filterStart/End/Init triggers
|
3552
3630
|
setTimeout( function() {
|
3553
3631
|
if ( !wo.filter_initialized ) {
|
@@ -3557,7 +3635,7 @@
|
|
3557
3635
|
});
|
3558
3636
|
// if filter widget is added after pager has initialized; then set filter init flag
|
3559
3637
|
if ( c.pager && c.pager.initialized && !wo.filter_initialized ) {
|
3560
|
-
c.$table.
|
3638
|
+
c.$table.triggerHandler( 'filterFomatterUpdate' );
|
3561
3639
|
setTimeout( function() {
|
3562
3640
|
tsf.filterInitComplete( c );
|
3563
3641
|
}, 100 );
|
@@ -3580,7 +3658,7 @@
|
|
3580
3658
|
count = 0,
|
3581
3659
|
completed = function() {
|
3582
3660
|
wo.filter_initialized = true;
|
3583
|
-
c.$table.
|
3661
|
+
c.$table.triggerHandler( 'filterInit', c );
|
3584
3662
|
tsf.findRows( c.table, c.$table.data( 'lastSearch' ) || [] );
|
3585
3663
|
};
|
3586
3664
|
if ( $.isEmptyObject( wo.filter_formatter ) ) {
|
@@ -3635,7 +3713,7 @@
|
|
3635
3713
|
for ( indx = 0; indx <= c.columns; indx++ ) {
|
3636
3714
|
// include data-column='all' external filters
|
3637
3715
|
col = indx === c.columns ? 'all' : indx;
|
3638
|
-
filters[indx] = $filters
|
3716
|
+
filters[ indx ] = $filters
|
3639
3717
|
.filter( '[data-column="' + col + '"]' )
|
3640
3718
|
.attr( wo.filter_defaultAttrib ) || filters[indx] || '';
|
3641
3719
|
}
|
@@ -3657,11 +3735,12 @@
|
|
3657
3735
|
buildFilter = '<tr role="row" class="' + tscss.filterRow + ' ' + c.cssIgnoreRow + '">';
|
3658
3736
|
for ( column = 0; column < columns; column++ ) {
|
3659
3737
|
if ( c.$headerIndexed[ column ].length ) {
|
3660
|
-
buildFilter += '<td data-column="' + column + '"';
|
3661
3738
|
// account for entire column set with colspan. See #1047
|
3662
3739
|
tmp = c.$headerIndexed[ column ] && c.$headerIndexed[ column ][0].colSpan || 0;
|
3663
3740
|
if ( tmp > 1 ) {
|
3664
|
-
buildFilter += ' colspan="' + tmp + '"';
|
3741
|
+
buildFilter += '<td data-column="' + column + '-' + ( column + tmp - 1 ) + '" colspan="' + tmp + '"';
|
3742
|
+
} else {
|
3743
|
+
buildFilter += '<td data-column="' + column + '"';
|
3665
3744
|
}
|
3666
3745
|
if ( arry ) {
|
3667
3746
|
buildFilter += ( cellFilter[ column ] ? ' class="' + cellFilter[ column ] + '"' : '' );
|
@@ -3680,7 +3759,8 @@
|
|
3680
3759
|
// assuming last cell of a column is the main column
|
3681
3760
|
$header = c.$headerIndexed[ column ];
|
3682
3761
|
if ( $header && $header.length ) {
|
3683
|
-
$filter = c.$filters.filter( '[data-column="' + column + '"]' );
|
3762
|
+
// $filter = c.$filters.filter( '[data-column="' + column + '"]' );
|
3763
|
+
$filter = tsf.getColumnElm( c, c.$filters, column );
|
3684
3764
|
ffxn = ts.getColumnData( table, wo.filter_functions, column );
|
3685
3765
|
makeSelect = ( wo.filter_functions && ffxn && typeof ffxn !== 'function' ) ||
|
3686
3766
|
$header.hasClass( 'filter-select' );
|
@@ -3720,7 +3800,8 @@
|
|
3720
3800
|
name = ( $.isArray( wo.filter_cssFilter ) ?
|
3721
3801
|
( typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '' ) :
|
3722
3802
|
wo.filter_cssFilter ) || '';
|
3723
|
-
|
3803
|
+
// copy data-column from table cell (it will include colspan)
|
3804
|
+
buildFilter.addClass( tscss.filter + ' ' + name ).attr( 'data-column', $filter.attr( 'data-column' ) );
|
3724
3805
|
if ( disabled ) {
|
3725
3806
|
buildFilter.attr( 'placeholder', '' ).addClass( tscss.filterDisabled )[0].disabled = true;
|
3726
3807
|
}
|
@@ -3828,7 +3909,7 @@
|
|
3828
3909
|
// show/hide filter row as needed
|
3829
3910
|
c.$table
|
3830
3911
|
.find( '.' + tscss.filterRow )
|
3831
|
-
.
|
3912
|
+
.triggerHandler( combinedFilters === '' ? 'mouseleave' : 'mouseenter' );
|
3832
3913
|
}
|
3833
3914
|
// return if the last search is the same; but filter === false when updating the search
|
3834
3915
|
// see example-widget-filter.html filter toggle buttons
|
@@ -3839,6 +3920,8 @@
|
|
3839
3920
|
c.lastCombinedFilter = null;
|
3840
3921
|
c.lastSearch = [];
|
3841
3922
|
}
|
3923
|
+
// define filter inside it is false
|
3924
|
+
filters = filters || [];
|
3842
3925
|
// convert filters to strings - see #1070
|
3843
3926
|
filters = Array.prototype.map ?
|
3844
3927
|
filters.map( String ) :
|
@@ -3846,7 +3929,7 @@
|
|
3846
3929
|
filters.join( '\u0000' ).split( '\u0000' );
|
3847
3930
|
|
3848
3931
|
if ( wo.filter_initialized ) {
|
3849
|
-
c.$table.
|
3932
|
+
c.$table.triggerHandler( 'filterStart', [ filters ] );
|
3850
3933
|
}
|
3851
3934
|
if ( c.showProcessing ) {
|
3852
3935
|
// give it time for the processing icon to kick in
|
@@ -3927,22 +4010,18 @@
|
|
3927
4010
|
}
|
3928
4011
|
return $input || $();
|
3929
4012
|
},
|
3930
|
-
|
4013
|
+
findRange: function( c, val, ignoreRanges ) {
|
3931
4014
|
// look for multiple columns '1-3,4-6,8' in data-column
|
3932
4015
|
var temp, ranges, range, start, end, singles, i, indx, len,
|
3933
|
-
|
3934
|
-
|
3935
|
-
//
|
3936
|
-
|
3937
|
-
columns = [],
|
3938
|
-
val = $.trim( tsf.getLatestSearch( $input ).attr( 'data-column' ) || '' );
|
3939
|
-
if ( /^[0-9]+$/.test(val)) {
|
3940
|
-
return parseInt( val, 10 );
|
4016
|
+
columns = [];
|
4017
|
+
if ( /^[0-9]+$/.test( val ) ) {
|
4018
|
+
// always return an array
|
4019
|
+
return [ parseInt( val, 10 ) ];
|
3941
4020
|
}
|
3942
4021
|
// process column range
|
3943
|
-
if (
|
4022
|
+
if ( !ignoreRanges && /-/.test( val ) ) {
|
3944
4023
|
ranges = val.match( /(\d+)\s*-\s*(\d+)/g );
|
3945
|
-
len = ranges.length;
|
4024
|
+
len = ranges ? ranges.length : 0;
|
3946
4025
|
for ( indx = 0; indx < len; indx++ ) {
|
3947
4026
|
range = ranges[indx].split( /\s*-\s*/ );
|
3948
4027
|
start = parseInt( range[0], 10 ) || 0;
|
@@ -3961,7 +4040,7 @@
|
|
3961
4040
|
}
|
3962
4041
|
}
|
3963
4042
|
// process single columns
|
3964
|
-
if (
|
4043
|
+
if ( !ignoreRanges && /,/.test( val ) ) {
|
3965
4044
|
singles = val.split( /\s*,\s*/ );
|
3966
4045
|
len = singles.length;
|
3967
4046
|
for ( i = 0; i < len; i++ ) {
|
@@ -3981,6 +4060,23 @@
|
|
3981
4060
|
}
|
3982
4061
|
return columns;
|
3983
4062
|
},
|
4063
|
+
getColumnElm: function( c, $elements, column ) {
|
4064
|
+
// data-column may contain multiple columns '1-3,5-6,8'
|
4065
|
+
// replaces: c.$filters.filter( '[data-column="' + column + '"]' );
|
4066
|
+
return $elements.filter( function() {
|
4067
|
+
var cols = tsf.findRange( c, $( this ).attr( 'data-column' ) );
|
4068
|
+
return $.inArray( column, cols ) > -1;
|
4069
|
+
});
|
4070
|
+
},
|
4071
|
+
multipleColumns: function( c, $input ) {
|
4072
|
+
// look for multiple columns '1-3,4-6,8' in data-column
|
4073
|
+
var wo = c.widgetOptions,
|
4074
|
+
// only target 'all' column inputs on initialization
|
4075
|
+
// & don't target 'all' column inputs if they don't exist
|
4076
|
+
targets = wo.filter_initialized || !$input.filter( wo.filter_anyColumnSelector ).length,
|
4077
|
+
val = $.trim( tsf.getLatestSearch( $input ).attr( 'data-column' ) || '' );
|
4078
|
+
return tsf.findRange( c, val, !targets );
|
4079
|
+
},
|
3984
4080
|
processTypes: function( c, data, vars ) {
|
3985
4081
|
var ffxn,
|
3986
4082
|
filterMatched = null,
|
@@ -4094,6 +4190,11 @@
|
|
4094
4190
|
data.filter = ts.replaceAccents( data.filter );
|
4095
4191
|
}
|
4096
4192
|
|
4193
|
+
// replace column specific default filters - see #1088
|
4194
|
+
if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
|
4195
|
+
data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
|
4196
|
+
}
|
4197
|
+
|
4097
4198
|
// data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
|
4098
4199
|
// data.filter = case sensitive
|
4099
4200
|
data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;
|
@@ -4382,7 +4483,8 @@
|
|
4382
4483
|
console.log( 'Completed filter widget search' + ts.benchmark(time) );
|
4383
4484
|
}
|
4384
4485
|
if ( wo.filter_initialized ) {
|
4385
|
-
c.$table.
|
4486
|
+
c.$table.triggerHandler( 'filterBeforeEnd', c );
|
4487
|
+
c.$table.triggerHandler( 'filterEnd', c );
|
4386
4488
|
}
|
4387
4489
|
setTimeout( function() {
|
4388
4490
|
ts.applyWidget( c.table ); // make sure zebra widget is applied
|
@@ -4747,7 +4849,7 @@
|
|
4747
4849
|
c.lastCombinedFilter = null;
|
4748
4850
|
c.lastSearch = [];
|
4749
4851
|
tsf.searching( c.table, filter, skipFirst );
|
4750
|
-
c.$table.
|
4852
|
+
c.$table.triggerHandler( 'filterFomatterUpdate' );
|
4751
4853
|
}
|
4752
4854
|
return !!valid;
|
4753
4855
|
};
|
@@ -4795,7 +4897,7 @@
|
|
4795
4897
|
}
|
4796
4898
|
}
|
4797
4899
|
if ( headers.length && triggerEvent !== false ) {
|
4798
|
-
c.$table.
|
4900
|
+
c.$table.triggerHandler( 'resize', [ headers ] );
|
4799
4901
|
}
|
4800
4902
|
wo.resize_flag = false;
|
4801
4903
|
};
|
@@ -5022,7 +5124,7 @@
|
|
5022
5124
|
}
|
5023
5125
|
}
|
5024
5126
|
|
5025
|
-
$table.
|
5127
|
+
$table.triggerHandler('stickyHeadersInit');
|
5026
5128
|
|
5027
5129
|
},
|
5028
5130
|
remove: function(table, c, wo) {
|
@@ -5350,7 +5452,7 @@
|
|
5350
5452
|
}
|
5351
5453
|
vars.mouseXPosition = event.pageX;
|
5352
5454
|
// dynamically update sticky header widths
|
5353
|
-
c.$table.
|
5455
|
+
c.$table.triggerHandler('stickyHeadersUpdate');
|
5354
5456
|
},
|
5355
5457
|
|
5356
5458
|
stopResize : function( c, wo ) {
|
@@ -5364,7 +5466,7 @@
|
|
5364
5466
|
vars.mouseXPosition = 0;
|
5365
5467
|
vars.$target = vars.$next = null;
|
5366
5468
|
// will update stickyHeaders, just in case, see #912
|
5367
|
-
c.$table.
|
5469
|
+
c.$table.triggerHandler('stickyHeadersUpdate');
|
5368
5470
|
}
|
5369
5471
|
};
|
5370
5472
|
|
@@ -5426,7 +5528,7 @@
|
|
5426
5528
|
}
|
5427
5529
|
|
5428
5530
|
// reset stickyHeader widths
|
5429
|
-
c.$table.
|
5531
|
+
c.$table.triggerHandler( 'stickyHeadersUpdate' );
|
5430
5532
|
if ( ts.storage && !refreshing ) {
|
5431
5533
|
ts.storage( this, ts.css.resizableStorage, {} );
|
5432
5534
|
}
|