2017-05-16 19:18:48 +00:00
|
|
|
/*! Parser: input & select - updated 5/16/2017 (v2.28.10) *//*
|
2015-03-26 15:48:43 +00:00
|
|
|
* for jQuery 1.7+ & tablesorter 2.7.11+
|
2013-03-26 21:16:13 +00:00
|
|
|
* Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html
|
|
|
|
*/
|
|
|
|
/*jshint browser: true, jquery:true, unused:false */
|
2015-05-04 04:00:10 +00:00
|
|
|
;( function( $ ) {
|
2015-07-23 04:29:51 +00:00
|
|
|
'use strict';
|
2013-03-26 21:16:13 +00:00
|
|
|
|
2015-05-04 04:00:10 +00:00
|
|
|
var updateServer = function( event, $table, $input ) {
|
2015-01-29 05:27:20 +00:00
|
|
|
// do something here to update your server, if needed
|
|
|
|
// event = change event object
|
|
|
|
// $table = jQuery object of the table that was just updated
|
2015-11-15 01:27:27 +00:00
|
|
|
// $input = jQuery object(s) of the input or select that was modified; in v2.24.6,
|
|
|
|
// if the thead has a checkbox, $input may include multiple elements
|
2015-01-29 05:27:20 +00:00
|
|
|
};
|
2013-03-26 21:16:13 +00:00
|
|
|
|
|
|
|
// Custom parser for parsing input values
|
2015-05-04 04:00:10 +00:00
|
|
|
// updated dynamically using the 'change' function below
|
2013-03-26 21:16:13 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-04 04:00:10 +00:00
|
|
|
id : 'inputs',
|
|
|
|
is : function() {
|
2013-03-26 21:16:13 +00:00
|
|
|
return false;
|
|
|
|
},
|
2015-05-04 04:00:10 +00:00
|
|
|
format : function( txt, table, cell ) {
|
2015-05-13 17:12:55 +00:00
|
|
|
var $input = $( cell ).find( 'input' );
|
|
|
|
return $input.length ? $input.val() : txt;
|
2013-03-26 21:16:13 +00:00
|
|
|
},
|
2014-02-19 10:28:45 +00:00
|
|
|
parsed : true, // filter widget flag
|
2015-05-04 04:00:10 +00:00
|
|
|
type : 'text'
|
2013-03-26 21:16:13 +00:00
|
|
|
});
|
|
|
|
|
2015-04-28 22:07:36 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-04 04:00:10 +00:00
|
|
|
id : 'inputs-numeric',
|
|
|
|
is : function() {
|
2015-04-28 22:07:36 +00:00
|
|
|
return false;
|
|
|
|
},
|
2015-05-04 04:00:10 +00:00
|
|
|
format : function( txt, table, cell ) {
|
2015-05-13 17:12:55 +00:00
|
|
|
var $input = $( cell ).find( 'input' );
|
|
|
|
var val = $input.length ? $input.val() : txt,
|
2015-05-04 04:00:10 +00:00
|
|
|
num = $.tablesorter.formatFloat( ( val || '' ).replace( /[^\w,. \-()]/g, '' ), table );
|
|
|
|
return txt && typeof num === 'number' ? num :
|
|
|
|
txt ? $.trim( txt && table.config.ignoreCase ? txt.toLocaleLowerCase() : txt ) : txt;
|
2015-04-28 22:07:36 +00:00
|
|
|
},
|
|
|
|
parsed : true, // filter widget flag
|
2015-05-04 04:00:10 +00:00
|
|
|
type : 'numeric'
|
2015-04-28 22:07:36 +00:00
|
|
|
});
|
|
|
|
|
2013-03-26 21:16:13 +00:00
|
|
|
// Custom parser for including checkbox status if using the grouping widget
|
2015-05-04 04:00:10 +00:00
|
|
|
// updated dynamically using the 'change' function below
|
2013-03-26 21:16:13 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-04 04:00:10 +00:00
|
|
|
id : 'checkbox',
|
|
|
|
is : function() {
|
2013-03-26 21:16:13 +00:00
|
|
|
return false;
|
|
|
|
},
|
2016-04-26 17:11:13 +00:00
|
|
|
format : function( txt, table, cell ) {
|
2015-05-04 04:00:10 +00:00
|
|
|
var $cell = $( cell ),
|
2015-03-05 13:03:08 +00:00
|
|
|
wo = table.config.widgetOptions,
|
|
|
|
// returning plain language here because this is what is shown in the
|
|
|
|
// group headers - change it as desired
|
2015-05-04 04:00:10 +00:00
|
|
|
status = wo.group_checkbox ? wo.group_checkbox : [ 'checked', 'unchecked' ],
|
|
|
|
$input = $cell.find( 'input[type="checkbox"]' ),
|
|
|
|
isChecked = $input.length ? $input[ 0 ].checked : '';
|
|
|
|
return $input.length ? status[ isChecked ? 0 : 1 ] : txt;
|
2013-03-26 21:16:13 +00:00
|
|
|
},
|
2014-02-19 10:28:45 +00:00
|
|
|
parsed : true, // filter widget flag
|
2015-05-04 04:00:10 +00:00
|
|
|
type : 'text'
|
2013-03-26 21:16:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Custom parser which returns the currently selected options
|
2015-05-04 04:00:10 +00:00
|
|
|
// updated dynamically using the 'change' function below
|
2013-03-26 21:16:13 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-04 04:00:10 +00:00
|
|
|
id : 'select',
|
|
|
|
is : function() {
|
2013-03-26 21:16:13 +00:00
|
|
|
return false;
|
|
|
|
},
|
2015-05-04 04:00:10 +00:00
|
|
|
format : function( txt, table, cell ) {
|
2015-05-13 17:12:55 +00:00
|
|
|
var $select = $( cell ).find( 'select' );
|
|
|
|
return $select.length ? $select.val() : txt;
|
2013-03-26 21:16:13 +00:00
|
|
|
},
|
2014-02-19 10:28:45 +00:00
|
|
|
parsed : true, // filter widget flag
|
2015-05-04 04:00:10 +00:00
|
|
|
type : 'text'
|
2013-03-26 21:16:13 +00:00
|
|
|
});
|
|
|
|
|
2014-07-15 22:14:27 +00:00
|
|
|
// Select parser to get the selected text
|
|
|
|
$.tablesorter.addParser({
|
2015-05-04 04:00:10 +00:00
|
|
|
id : 'select-text',
|
|
|
|
is : function() {
|
2014-07-15 22:14:27 +00:00
|
|
|
return false;
|
|
|
|
},
|
2015-05-04 04:00:10 +00:00
|
|
|
format : function( txt, table, cell ) {
|
|
|
|
var $select = $( cell ).find( 'select' );
|
|
|
|
return $select.length ? $select.find( 'option:selected' ).text() || '' : txt;
|
2014-07-15 22:14:27 +00:00
|
|
|
},
|
|
|
|
parsed : true, // filter widget flag
|
2015-05-04 04:00:10 +00:00
|
|
|
type : 'text'
|
2014-07-15 22:14:27 +00:00
|
|
|
});
|
|
|
|
|
2014-07-23 17:05:46 +00:00
|
|
|
// Custom parser for parsing textarea values
|
2015-05-04 04:00:10 +00:00
|
|
|
// updated dynamically using the 'change' function below
|
2014-07-23 17:05:46 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-04 04:00:10 +00:00
|
|
|
id : 'textarea',
|
|
|
|
is : function() {
|
2014-07-23 17:05:46 +00:00
|
|
|
return false;
|
|
|
|
},
|
2015-05-04 04:00:10 +00:00
|
|
|
format : function( txt, table, cell ) {
|
2015-05-13 17:12:55 +00:00
|
|
|
var $textarea = $( cell ).find( 'textarea' );
|
|
|
|
return $textarea.length ? $textarea.val() : txt;
|
2014-07-23 17:05:46 +00:00
|
|
|
},
|
|
|
|
parsed : true, // filter widget flag
|
2015-05-04 04:00:10 +00:00
|
|
|
type : 'text'
|
2014-07-23 17:05:46 +00:00
|
|
|
});
|
|
|
|
|
2016-11-26 16:39:31 +00:00
|
|
|
// update defaults for validator; values must be falsy
|
2016-11-27 01:40:00 +00:00
|
|
|
$.tablesorter.defaults.checkboxClass = '';
|
|
|
|
$.tablesorter.defaults.checkboxVisible = '';
|
2016-11-26 16:39:31 +00:00
|
|
|
|
2013-03-26 21:16:13 +00:00
|
|
|
// update select and all input types in the tablesorter cache when the change event fires.
|
|
|
|
// This method only works with jQuery 1.7+
|
|
|
|
// you can change it to use delegate (v1.4.3+) or live (v1.3+) as desired
|
|
|
|
// if this code interferes somehow, target the specific table $('#mytable'), instead of $('table')
|
2015-05-04 04:00:10 +00:00
|
|
|
$( function() {
|
2015-11-15 01:27:27 +00:00
|
|
|
if ( !$.fn.on ) { return; }
|
2015-11-30 18:07:58 +00:00
|
|
|
var toggleRowClass = function( $row, checkboxClass, indx, isChecked ) {
|
|
|
|
// adding class to row, indicating that a checkbox is checked; includes
|
|
|
|
// a column index in case more than one checkbox happens to be in a row
|
|
|
|
$row.toggleClass( checkboxClass + '-' + indx, isChecked );
|
|
|
|
// don't remove checked class if other columns have a check
|
|
|
|
if ( ( $row[0].className || '' ).match( checkboxClass + '-' ) ) {
|
|
|
|
$row.addClass( checkboxClass );
|
|
|
|
} else {
|
|
|
|
$row.removeClass( checkboxClass );
|
|
|
|
}
|
|
|
|
},
|
2017-05-16 19:18:48 +00:00
|
|
|
updateCheckbox = function($el, state) {
|
|
|
|
if ($el[0].nodeName !== 'INPUT') {
|
|
|
|
$el = $el.find( 'input[type="checkbox"]' );
|
|
|
|
}
|
|
|
|
if ($el.length) {
|
|
|
|
var ua = window.navigator.userAgent;
|
|
|
|
if (state === 'indeterminate') {
|
|
|
|
// needed for IE
|
|
|
|
$el.prop('checked', !(ua.indexOf('Trident/') > -1 || ua.indexOf('Edge/') > -1));
|
|
|
|
$el.prop('indeterminate', true);
|
|
|
|
} else {
|
|
|
|
$el.prop('checked', state);
|
|
|
|
$el.prop('indeterminate', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-11-30 18:07:58 +00:00
|
|
|
updateHeaderCheckbox = function( $table, checkboxClass ) {
|
2017-05-16 19:18:48 +00:00
|
|
|
var $rows = $table.children( 'tbody' ).children( ':visible' ), // (include child rows?)
|
|
|
|
len = $rows.length,
|
|
|
|
hasSticky = $table[0].config.widgetOptions.$sticky;
|
2015-11-30 18:07:58 +00:00
|
|
|
// set indeterminate state on header checkbox
|
|
|
|
$table.children( 'thead' ).find( 'input[type="checkbox"]' ).each( function() {
|
|
|
|
var column = $( this ).closest( 'td, th' ).attr( 'data-column' ),
|
2017-05-16 19:18:48 +00:00
|
|
|
$sticky = hasSticky.find( '[data-column="' + column + '"]' ),
|
2015-11-30 18:07:58 +00:00
|
|
|
vis = $rows.filter( '.' + checkboxClass + '-' + column ).length,
|
2016-08-24 17:06:42 +00:00
|
|
|
allChecked = vis === len && len > 0;
|
2015-11-30 18:07:58 +00:00
|
|
|
if ( vis === 0 || allChecked ) {
|
2017-05-16 19:18:48 +00:00
|
|
|
updateCheckbox($(this), allChecked);
|
|
|
|
if ($sticky) {
|
|
|
|
updateCheckbox($sticky, allChecked);
|
|
|
|
}
|
2015-11-30 18:07:58 +00:00
|
|
|
} else {
|
2017-05-16 19:18:48 +00:00
|
|
|
updateCheckbox($(this), 'indeterminate');
|
|
|
|
if ($sticky) {
|
|
|
|
updateCheckbox($sticky, 'indeterminate');
|
|
|
|
}
|
2015-11-30 18:07:58 +00:00
|
|
|
}
|
|
|
|
});
|
2017-05-16 19:18:48 +00:00
|
|
|
|
2015-11-30 18:07:58 +00:00
|
|
|
};
|
|
|
|
|
2015-05-04 04:00:10 +00:00
|
|
|
$( 'table' ).on( 'tablesorter-initialized updateComplete', function() {
|
2015-11-15 01:27:27 +00:00
|
|
|
this.tablesorterBusy = false;
|
|
|
|
var namespace = '.parser-forms';
|
2017-05-16 19:18:48 +00:00
|
|
|
$( this )
|
|
|
|
// add namespace to table in case of version mismatch (v2.28.10)
|
|
|
|
.addClass( this.config.namespace.slice(1) )
|
|
|
|
.children( 'tbody' )
|
2015-11-15 01:27:27 +00:00
|
|
|
.off( namespace )
|
|
|
|
.on( 'mouseleave' + namespace, function( event ) {
|
2015-01-29 05:27:20 +00:00
|
|
|
// make sure we restore original values (trigger blur)
|
|
|
|
// isTbody is needed to prevent the select from closing in IE
|
|
|
|
// see https://connect.microsoft.com/IE/feedbackdetail/view/962618/
|
2015-11-15 01:27:27 +00:00
|
|
|
if ( event.target.nodeName === 'TBODY' ) {
|
2015-05-04 04:00:10 +00:00
|
|
|
$( ':focus' ).blur();
|
2015-01-29 05:27:20 +00:00
|
|
|
}
|
2014-08-01 17:00:10 +00:00
|
|
|
})
|
2017-05-12 08:42:49 +00:00
|
|
|
.on( 'focus' + namespace, 'select, input:not([type=checkbox]), textarea', function( event ) {
|
2017-05-12 12:12:16 +00:00
|
|
|
var $row = $( event.target ).closest( 'tr' ),
|
|
|
|
c = $row.closest( 'table' )[0].config;
|
|
|
|
if ( !c || c && c.ignoreChildRow && $row.hasClass( c.cssChildRow ) ) {
|
2017-05-12 08:42:49 +00:00
|
|
|
return;
|
|
|
|
}
|
2015-05-04 04:00:10 +00:00
|
|
|
$( this ).data( 'ts-original-value', this.value );
|
2014-08-01 17:00:10 +00:00
|
|
|
})
|
2017-05-12 08:42:49 +00:00
|
|
|
.on( 'blur' + namespace, 'input:not([type=checkbox]), textarea', function( event ) {
|
2017-05-12 12:12:16 +00:00
|
|
|
var $row = $( event.target ).closest( 'tr' ),
|
|
|
|
c = $row.closest( 'table' )[0].config;
|
|
|
|
if ( !c || c && c.ignoreChildRow && $row.hasClass( c.cssChildRow ) ) {
|
2017-05-12 08:42:49 +00:00
|
|
|
return;
|
|
|
|
}
|
2014-08-01 17:00:10 +00:00
|
|
|
// restore input value;
|
2015-05-04 04:00:10 +00:00
|
|
|
// 'change' is triggered before 'blur' so this doesn't replace the new update with the original
|
|
|
|
this.value = $( this ).data( 'ts-original-value' );
|
2014-08-01 17:00:10 +00:00
|
|
|
})
|
2015-05-04 04:00:10 +00:00
|
|
|
.on( 'change keyup '.split( ' ' ).join( namespace + ' ' ), 'select, input, textarea', function( event ) {
|
2017-05-12 12:12:16 +00:00
|
|
|
var $row = $( this ).closest( 'tr' ),
|
|
|
|
c = $row.closest( 'table' )[0].config;
|
|
|
|
if ( !c || c && c.ignoreChildRow && $row.hasClass( c.cssChildRow ) ) {
|
2017-05-12 08:42:49 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-01-14 02:50:17 +00:00
|
|
|
if ( event.which === 27 && !( this.nodeName === 'INPUT' && this.type === 'checkbox' ) ) {
|
2014-08-01 17:00:10 +00:00
|
|
|
// escape: restore original value
|
2015-05-04 04:00:10 +00:00
|
|
|
this.value = $( this ).data( 'ts-original-value' );
|
2014-08-02 02:31:33 +00:00
|
|
|
return;
|
2014-08-01 17:00:10 +00:00
|
|
|
}
|
|
|
|
// Update cell cache using... select: change, input: enter or textarea: alt + enter
|
2015-05-04 04:00:10 +00:00
|
|
|
if ( event.type === 'change' ||
|
|
|
|
( event.type === 'keyup' && event.which === 13 &&
|
|
|
|
( event.target.nodeName === 'INPUT' || event.target.nodeName === 'TEXTAREA' && event.altKey ) ) ) {
|
2015-11-30 18:07:58 +00:00
|
|
|
var undef, checkboxClass,
|
2015-05-04 04:00:10 +00:00
|
|
|
$target = $( event.target ),
|
2015-11-15 01:27:27 +00:00
|
|
|
isCheckbox = event.target.type === 'checkbox',
|
2015-05-04 04:00:10 +00:00
|
|
|
$cell = $target.closest( 'td' ),
|
|
|
|
indx = $cell[ 0 ].cellIndex,
|
2017-05-12 12:12:16 +00:00
|
|
|
busy = c.table.tablesorterBusy,
|
|
|
|
$hdr = c.$headerIndexed && c.$headerIndexed[ indx ] || [],
|
2015-11-15 01:27:27 +00:00
|
|
|
val = isCheckbox ? event.target.checked : $target.val();
|
2015-11-30 18:07:58 +00:00
|
|
|
// abort if not a tablesorter table, or busy
|
|
|
|
if ( $.isEmptyObject( c ) || busy !== false ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ( isCheckbox ) {
|
|
|
|
checkboxClass = c.checkboxClass || 'checked';
|
|
|
|
toggleRowClass( $cell.closest( 'tr' ), checkboxClass, indx, val );
|
2017-05-12 12:12:16 +00:00
|
|
|
updateHeaderCheckbox( c.$table, checkboxClass );
|
2015-11-30 18:07:58 +00:00
|
|
|
}
|
|
|
|
// don't use updateCell if column is set to 'sorter-false' and 'filter-false',
|
|
|
|
// or column is set to 'parser-false'
|
|
|
|
if ( $hdr.length && ( $hdr.hasClass( 'parser-false' ) ||
|
2015-11-15 01:27:27 +00:00
|
|
|
( $hdr.hasClass( 'sorter-false' ) && $hdr.hasClass( 'filter-false' ) ) ) ||
|
|
|
|
// table already updating; get out of here, we might be in an endless loop (in IE)! See #971
|
|
|
|
( event.type === 'change' && c.table.isUpdating ) ) {
|
2015-05-04 04:00:10 +00:00
|
|
|
return;
|
2014-08-01 17:00:10 +00:00
|
|
|
}
|
|
|
|
// ignore change event if nothing changed
|
2015-11-15 01:27:27 +00:00
|
|
|
if ( c && val !== $target.data( 'ts-original-value' ) || isCheckbox ) {
|
2015-05-04 04:00:10 +00:00
|
|
|
$target.data( 'ts-original-value', val );
|
2017-05-12 12:12:16 +00:00
|
|
|
c.table.tablesorterBusy = true;
|
2015-01-29 05:27:20 +00:00
|
|
|
// pass undefined resort value so it falls back to config.resort setting
|
2015-10-22 21:41:34 +00:00
|
|
|
$.tablesorter.updateCell( c, $cell, undef, function() {
|
2017-05-12 12:12:16 +00:00
|
|
|
updateServer( event, c.$table, $target );
|
|
|
|
c.table.tablesorterBusy = false;
|
2015-10-22 21:41:34 +00:00
|
|
|
});
|
2014-07-09 02:27:22 +00:00
|
|
|
}
|
2014-04-27 01:30:13 +00:00
|
|
|
}
|
2014-07-09 02:27:22 +00:00
|
|
|
});
|
2015-11-15 01:27:27 +00:00
|
|
|
|
|
|
|
// add code for a checkbox in the header to set/unset all checkboxes in a column
|
|
|
|
if ( $( this ).children( 'thead' ).find( 'input[type="checkbox"]' ) ) {
|
|
|
|
$( this )
|
|
|
|
.off( namespace )
|
|
|
|
.on( 'tablesorter-ready' + namespace, function() {
|
2016-04-26 17:11:13 +00:00
|
|
|
var checkboxClass,
|
2015-11-15 01:27:27 +00:00
|
|
|
$table = $( this ),
|
|
|
|
c = $table.length && $table[ 0 ].config;
|
|
|
|
if ( !$.isEmptyObject( c ) ) {
|
|
|
|
this.tablesorterBusy = true;
|
|
|
|
checkboxClass = c && c.checkboxClass || 'checked';
|
|
|
|
// set indeterminate state on header checkbox
|
2015-11-30 18:07:58 +00:00
|
|
|
updateHeaderCheckbox( $table, checkboxClass );
|
2015-11-15 01:27:27 +00:00
|
|
|
this.tablesorterBusy = false;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.children( 'thead' )
|
2017-05-16 19:18:48 +00:00
|
|
|
.add( this.config.widgetOptions.$sticky )
|
2015-11-15 01:27:27 +00:00
|
|
|
.off( namespace )
|
|
|
|
// modified from http://jsfiddle.net/abkNM/6163/
|
2016-04-26 19:20:04 +00:00
|
|
|
// click needed for IE; a change isn't fired when going from an indeterminate checkbox to
|
|
|
|
// either checked or unchecked
|
|
|
|
.on( 'click' + namespace + ' change' + namespace, 'input[type="checkbox"]', function( event ) {
|
2017-05-16 19:18:48 +00:00
|
|
|
var c, undef, onlyVisible, column, $target, isParsed, checkboxClass,
|
2015-11-15 01:27:27 +00:00
|
|
|
$checkbox = $( this ),
|
2017-05-16 19:18:48 +00:00
|
|
|
isChecked = this.checked,
|
2015-11-15 01:27:27 +00:00
|
|
|
$table = $checkbox.closest( 'table' ),
|
2017-05-16 19:18:48 +00:00
|
|
|
isSticky = $table.length && $table[0].className.match(/(tablesorter\w+)_extra_table/);
|
|
|
|
if (isSticky) {
|
|
|
|
isSticky = isSticky[1];
|
|
|
|
$table = $('.' + isSticky + ':not(.' + isSticky + '_extra_table)');
|
|
|
|
}
|
|
|
|
c = $table.length && $table[ 0 ].config;
|
2015-11-15 01:27:27 +00:00
|
|
|
if ( $table.length && c && !$table[ 0 ].tablesorterBusy ) {
|
|
|
|
column = parseInt( $checkbox.closest( 'td, th' ).attr( 'data-column' ), 10 );
|
2015-11-30 18:07:58 +00:00
|
|
|
isParsed = c.parsers[ column ].id === 'checkbox';
|
2017-05-16 19:18:48 +00:00
|
|
|
onlyVisible = c.checkboxVisible;
|
2015-11-15 01:27:27 +00:00
|
|
|
$table[ 0 ].tablesorterBusy = true; // prevent "change" event from calling updateCell numerous times (see #971)
|
2017-05-16 19:18:48 +00:00
|
|
|
updateCheckbox(
|
|
|
|
$target = $table
|
|
|
|
.children( 'tbody' )
|
|
|
|
.children( 'tr' + ( typeof onlyVisible === 'undefined' || onlyVisible === true ? ':visible' : '' ) )
|
|
|
|
.children( ':nth-child(' + ( column + 1 ) + ')' ),
|
|
|
|
isChecked
|
|
|
|
);
|
2016-04-26 17:11:13 +00:00
|
|
|
// add checkbox class names to row
|
|
|
|
checkboxClass = c.checkboxClass || 'checked';
|
|
|
|
$target.each( function() {
|
|
|
|
toggleRowClass( $( this ).closest( 'tr' ), checkboxClass, column, isChecked );
|
|
|
|
});
|
2017-05-16 19:18:48 +00:00
|
|
|
if (isSticky) {
|
|
|
|
// make main table checkbox match sticky header checkbox
|
|
|
|
updateCheckbox($table.children( 'thead' ).find( '[data-column="' + column + '"]' ), isChecked);
|
|
|
|
} else if (c.widgetOptions.$sticky) {
|
|
|
|
updateCheckbox(c.widgetOptions.$sticky.find( 'thead' ).find( '[data-column="' + column + '"]' ), isChecked);
|
|
|
|
}
|
2016-04-26 17:11:13 +00:00
|
|
|
updateHeaderCheckbox( $table, checkboxClass );
|
|
|
|
if ( isParsed ) {
|
2015-11-30 18:07:58 +00:00
|
|
|
// only update cache if checkboxes are being sorted
|
|
|
|
$.tablesorter.update( c, undef, function() {
|
|
|
|
updateServer( event, $table, $target );
|
|
|
|
$table[ 0 ].tablesorterBusy = false;
|
|
|
|
});
|
2016-04-26 17:11:13 +00:00
|
|
|
} else {
|
|
|
|
updateServer( event, $table, $target );
|
|
|
|
$table[ 0 ].tablesorterBusy = false;
|
2015-11-30 18:07:58 +00:00
|
|
|
}
|
2015-12-02 13:38:22 +00:00
|
|
|
// needed for IE8
|
|
|
|
return true;
|
2015-11-15 01:27:27 +00:00
|
|
|
}
|
|
|
|
// update already going on, don't do anything!
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2013-03-26 21:16:13 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2015-05-04 04:00:10 +00:00
|
|
|
})( jQuery );
|