diff --git a/js/jquery.tablesorter.widgets-filter-formatter.js b/js/jquery.tablesorter.widgets-filter-formatter.js index 74a4c048..0d9ff1da 100644 --- a/js/jquery.tablesorter.widgets-filter-formatter.js +++ b/js/jquery.tablesorter.widgets-filter-formatter.js @@ -1,13 +1,14 @@ -/*! Filter widget formatter functions - updated 5/8/2013 +/*! Filter widget formatter functions - updated 5/24/2013 * requires: tableSorter 2.7.7+ and jQuery 1.4.3+ * - * jQuery UI spinner - * jQuery UI slider - * jQuery UI range slider - * jQuery UI datepicker (range) - * HTML5 number (spinner) - * HTML5 range slider - * HTML5 color selector + * uiSpinner (jQuery UI spinner) + * uiSlider (jQuery UI slider) + * uiRange (jQuery UI range slider) + * uiDateCompare (jQuery UI datepicker; 1 input) + * uiDatepicker (jQuery UI datepicker; 2 inputs, filter range) + * html5Number (spinner) + * html5Range (slider) + * html5Color (color) */ /*jshint browser:true, jquery:true, unused:false */ /*global jQuery: false */ @@ -248,7 +249,7 @@ $.tablesorter.filterFormatter = { // make sure we're using parsed dates in the search $hdr.addClass('filter-parsed'); // Add date range picker - $('' + o.cellText + '').appendTo($cell); + $('' + o.cellText + '').appendTo($cell); // add callbacks; preserve added callbacks o.oldonClose = o.onClose; diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index a79d42b5..013e0983 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -547,7 +547,9 @@ ts.addWidget({ buildSelect = function(i, updating, onlyavail){ var o, t, arry = [], currentVal; i = parseInt(i, 10); - o = ''; + t = $ths.filter('[data-column="' + i + '"]:last'); + // t.data('placeholder') won't work in jQuery older than 1.4.3 + o = ''; for (k = 0; k < b.length; k++ ){ l = c.cache[k].row.length; // loop through the rows @@ -651,7 +653,7 @@ ts.addWidget({ t = $('').appendTo( c.$filters.eq(i) ); } if (t) { - t.attr('placeholder', $th.attr('data-placeholder') || ''); + t.attr('placeholder', $th.data('placeholder') || $th.attr('data-placeholder') || ''); } } if (t) { @@ -715,7 +717,7 @@ ts.addWidget({ // add custom drop down list for (str in wo.filter_functions[col]){ if (typeof str === 'string'){ - ff += ff === '' ? '' : ''; + ff += ff === '' ? '' : ''; ff += ''; } }