diff --git a/js/widgets/widget-columnSelector.js b/js/widgets/widget-columnSelector.js index 4432c671..aee6ddfb 100644 --- a/js/widgets/widget-columnSelector.js +++ b/js/widgets/widget-columnSelector.js @@ -256,9 +256,11 @@ tsColSel = ts.columnSelector = { $popup.find('.tablesorter-column-selector') .html( colSel.$container.html() ) .find('input').each(function(){ - var indx = $(this).toggleClass( wo.columnSelector_cssChecked, isChecked ).attr('data-column'), + var indx = $(this).attr('data-column'), isChecked = indx === 'auto' ? colSel.auto : colSel.states[indx]; - $(this).prop( 'checked', isChecked ); + $(this) + .toggleClass( wo.columnSelector_cssChecked, isChecked ) + .prop( 'checked', isChecked ); }); colSel.$popup = $popup.on('change', 'input', function(){ // data input