Merge branch 'master' into gh-pages
12
README.md
@ -104,6 +104,18 @@ If you would like to contribute, please...
|
|||||||
|
|
||||||
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
|
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
|
||||||
|
|
||||||
|
#### <a name="v2.28.12">Version 2.28.12</a> (5/26/2017)
|
||||||
|
|
||||||
|
* ColumnSelector:
|
||||||
|
* Don't clear container on updateAll. Fixes [issue #1406](https://github.com/Mottie/tablesorter/issues/1406).
|
||||||
|
* Filter:
|
||||||
|
* Return `null` from `filter_selectSource` to prevent select updates; From discussion in IRC with [@alexweissman](https://github.com/alexweissman).
|
||||||
|
* Select searches now process filter types, then exactly match. Previously only exact matches were performed by default, filter types were ignored. This broke the filter + jQuery UI selectmenu demo.
|
||||||
|
* Docs/Meta:
|
||||||
|
* Fix linting issues.
|
||||||
|
* Update jQuery UI to v1.12.1.
|
||||||
|
* Update [filter selectmenu demo](https://mottie.github.io/tablesorter/docs/example-widget-filter-selectmenu.html).
|
||||||
|
|
||||||
#### <a name="v2.28.11">Version 2.28.11</a> (5/24/2017)
|
#### <a name="v2.28.11">Version 2.28.11</a> (5/24/2017)
|
||||||
|
|
||||||
* Docs:
|
* Docs:
|
||||||
|
38
dist/js/jquery.tablesorter.combined.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/
|
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
|
||||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||||
(function(factory) {
|
(function(factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
}(function(jQuery) {
|
}(function(jQuery) {
|
||||||
|
|
||||||
/*! TableSorter (FORK) v2.28.11 *//*
|
/*! TableSorter (FORK) v2.28.12 *//*
|
||||||
* Client-side table sorting with ease!
|
* Client-side table sorting with ease!
|
||||||
* @requires jQuery v1.2.6+
|
* @requires jQuery v1.2.6+
|
||||||
*
|
*
|
||||||
@ -34,7 +34,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var ts = $.tablesorter = {
|
var ts = $.tablesorter = {
|
||||||
|
|
||||||
version : '2.28.11',
|
version : '2.28.12',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
@ -4073,7 +4073,7 @@
|
|||||||
// change & input events must be ignored if liveSearch !== true
|
// change & input events must be ignored if liveSearch !== true
|
||||||
( eventType === 'change' || eventType === 'input' ) &&
|
( eventType === 'change' || eventType === 'input' ) &&
|
||||||
// prevent search if liveSearch is a number
|
// prevent search if liveSearch is a number
|
||||||
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
|
( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
|
||||||
// don't allow 'change' or 'input' event to process if the input value
|
// don't allow 'change' or 'input' event to process if the input value
|
||||||
// is the same - fixes #685
|
// is the same - fixes #685
|
||||||
this.value !== c.lastSearch[column]
|
this.value !== c.lastSearch[column]
|
||||||
@ -4468,13 +4468,7 @@
|
|||||||
fxn = vars.functions[ columnIndex ];
|
fxn = vars.functions[ columnIndex ];
|
||||||
filterMatched = null;
|
filterMatched = null;
|
||||||
if ( fxn ) {
|
if ( fxn ) {
|
||||||
if ( fxn === true ) {
|
if ( typeof fxn === 'function' ) {
|
||||||
// default selector uses exact match unless 'filter-match' class is found
|
|
||||||
filterMatched = data.isMatch ?
|
|
||||||
// data.iExact may be a number
|
|
||||||
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
|
||||||
data.filter === data.exact;
|
|
||||||
} else if ( typeof fxn === 'function' ) {
|
|
||||||
// filter callback( exact cell content, parser normalized content,
|
// filter callback( exact cell content, parser normalized content,
|
||||||
// filter input value, column index, jQuery row object )
|
// filter input value, column index, jQuery row object )
|
||||||
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
||||||
@ -4493,8 +4487,18 @@
|
|||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
// Look for match, and add child row data for matching
|
// Look for match, and add child row data for matching
|
||||||
} else {
|
} else {
|
||||||
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
// check fxn (filter-select in header) after filter types are checked
|
||||||
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
// without this, the filter + jQuery UI selectmenu demo was breaking
|
||||||
|
if ( fxn === true ) {
|
||||||
|
// default selector uses exact match unless 'filter-match' class is found
|
||||||
|
result = data.isMatch ?
|
||||||
|
// data.iExact may be a number
|
||||||
|
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
||||||
|
data.filter === data.exact;
|
||||||
|
} else {
|
||||||
|
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
||||||
|
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
@ -4794,6 +4798,10 @@
|
|||||||
} else if ( $.type( source ) === 'object' && fxn ) {
|
} else if ( $.type( source ) === 'object' && fxn ) {
|
||||||
// custom select source function for a SPECIFIC COLUMN
|
// custom select source function for a SPECIFIC COLUMN
|
||||||
arry = fxn( table, column, onlyAvail );
|
arry = fxn( table, column, onlyAvail );
|
||||||
|
// abort - updating the selects from an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( arry === false ) {
|
if ( arry === false ) {
|
||||||
// fall back to original method
|
// fall back to original method
|
||||||
@ -4951,6 +4959,10 @@
|
|||||||
// filter_selectSource or column data
|
// filter_selectSource or column data
|
||||||
if ( typeof arry === 'undefined' || arry === '' ) {
|
if ( typeof arry === 'undefined' || arry === '' ) {
|
||||||
arry = tsf.getOptionSource( table, column, onlyAvail );
|
arry = tsf.getOptionSource( table, column, onlyAvail );
|
||||||
|
// abort, selects are updated by an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $.isArray( arry ) ) {
|
if ( $.isArray( arry ) ) {
|
||||||
|
4
dist/js/jquery.tablesorter.combined.min.js
vendored
4
dist/js/jquery.tablesorter.js
vendored
@ -8,7 +8,7 @@
|
|||||||
}
|
}
|
||||||
}(function(jQuery) {
|
}(function(jQuery) {
|
||||||
|
|
||||||
/*! TableSorter (FORK) v2.28.11 *//*
|
/*! TableSorter (FORK) v2.28.12 *//*
|
||||||
* Client-side table sorting with ease!
|
* Client-side table sorting with ease!
|
||||||
* @requires jQuery v1.2.6+
|
* @requires jQuery v1.2.6+
|
||||||
*
|
*
|
||||||
@ -32,7 +32,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var ts = $.tablesorter = {
|
var ts = $.tablesorter = {
|
||||||
|
|
||||||
version : '2.28.11',
|
version : '2.28.12',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
|
2
dist/js/jquery.tablesorter.min.js
vendored
34
dist/js/jquery.tablesorter.widgets.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/
|
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
|
||||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||||
(function(factory) {
|
(function(factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
@ -1253,7 +1253,7 @@
|
|||||||
// change & input events must be ignored if liveSearch !== true
|
// change & input events must be ignored if liveSearch !== true
|
||||||
( eventType === 'change' || eventType === 'input' ) &&
|
( eventType === 'change' || eventType === 'input' ) &&
|
||||||
// prevent search if liveSearch is a number
|
// prevent search if liveSearch is a number
|
||||||
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
|
( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
|
||||||
// don't allow 'change' or 'input' event to process if the input value
|
// don't allow 'change' or 'input' event to process if the input value
|
||||||
// is the same - fixes #685
|
// is the same - fixes #685
|
||||||
this.value !== c.lastSearch[column]
|
this.value !== c.lastSearch[column]
|
||||||
@ -1648,13 +1648,7 @@
|
|||||||
fxn = vars.functions[ columnIndex ];
|
fxn = vars.functions[ columnIndex ];
|
||||||
filterMatched = null;
|
filterMatched = null;
|
||||||
if ( fxn ) {
|
if ( fxn ) {
|
||||||
if ( fxn === true ) {
|
if ( typeof fxn === 'function' ) {
|
||||||
// default selector uses exact match unless 'filter-match' class is found
|
|
||||||
filterMatched = data.isMatch ?
|
|
||||||
// data.iExact may be a number
|
|
||||||
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
|
||||||
data.filter === data.exact;
|
|
||||||
} else if ( typeof fxn === 'function' ) {
|
|
||||||
// filter callback( exact cell content, parser normalized content,
|
// filter callback( exact cell content, parser normalized content,
|
||||||
// filter input value, column index, jQuery row object )
|
// filter input value, column index, jQuery row object )
|
||||||
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
||||||
@ -1673,8 +1667,18 @@
|
|||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
// Look for match, and add child row data for matching
|
// Look for match, and add child row data for matching
|
||||||
} else {
|
} else {
|
||||||
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
// check fxn (filter-select in header) after filter types are checked
|
||||||
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
// without this, the filter + jQuery UI selectmenu demo was breaking
|
||||||
|
if ( fxn === true ) {
|
||||||
|
// default selector uses exact match unless 'filter-match' class is found
|
||||||
|
result = data.isMatch ?
|
||||||
|
// data.iExact may be a number
|
||||||
|
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
||||||
|
data.filter === data.exact;
|
||||||
|
} else {
|
||||||
|
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
||||||
|
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
@ -1974,6 +1978,10 @@
|
|||||||
} else if ( $.type( source ) === 'object' && fxn ) {
|
} else if ( $.type( source ) === 'object' && fxn ) {
|
||||||
// custom select source function for a SPECIFIC COLUMN
|
// custom select source function for a SPECIFIC COLUMN
|
||||||
arry = fxn( table, column, onlyAvail );
|
arry = fxn( table, column, onlyAvail );
|
||||||
|
// abort - updating the selects from an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( arry === false ) {
|
if ( arry === false ) {
|
||||||
// fall back to original method
|
// fall back to original method
|
||||||
@ -2131,6 +2139,10 @@
|
|||||||
// filter_selectSource or column data
|
// filter_selectSource or column data
|
||||||
if ( typeof arry === 'undefined' || arry === '' ) {
|
if ( typeof arry === 'undefined' || arry === '' ) {
|
||||||
arry = tsf.getOptionSource( table, column, onlyAvail );
|
arry = tsf.getOptionSource( table, column, onlyAvail );
|
||||||
|
// abort, selects are updated by an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $.isArray( arry ) ) {
|
if ( $.isArray( arry ) ) {
|
||||||
|
4
dist/js/jquery.tablesorter.widgets.min.js
vendored
2
dist/js/parsers/parser-input-select.min.js
vendored
2
dist/js/parsers/parser-roman.min.js
vendored
@ -1,2 +1,2 @@
|
|||||||
/*! Parser: roman - updated 6/28/MMXIV (v2.17.3) */
|
/*! Parser: roman - updated 6/28/MMXIV (v2.17.3) */
|
||||||
!function(r){"use strict";var t=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,e={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};r.tablesorter.addParser({id:"roman",is:function(){return!1},format:function(r){var n,i=r.toUpperCase().split(""),a=0;if(!r||!t.test(r))return r;for(;i.length;)a+=(n=e[i.shift()])*(n<e[i[0]]?-1:1);return a},type:"numeric"}),r.tablesorter.addParser({id:"roman-ignore",is:function(){return!1},format:function(n,i,a,o){var s,u,f=i.config,c=r.isArray(f.roman_ignore)?f.roman_ignore[o]:0,p=(isNaN(c)?r.trim(n.replace(c,"")):r.trim(n.substring(0,n.length-c))).match(/\b([MCDLXVI]+\b)/gi),m=0;if(!t.test(p))return n;for(p=(u=p[0]).toUpperCase().split("");p.length;)(s=e[p.shift()])&&(m+=s*(s<e[p[0]]?-1:1));return m?n.replace(u,m):n},type:"text"}),r.tablesorter.addParser({id:"roman-extract",is:function(){return!1},format:function(n){var i,a=r.grep(n.split(/\b/),function(r,e){return t.test(r)?r:""}).join("").match(/\b([MCDLXVI]+\b)/gi),o=0;if(!(a?t.test(a):0))return n;for(a=a[0].toUpperCase().split("");a.length;)(i=e[a.shift()])&&(o+=i*(i<e[a[0]]?-1:1));return o||n},type:"numeric"})}(jQuery);
|
!function(r){"use strict";var t=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,e=/\b([MCDLXVI]+\b)/gi,n={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};r.tablesorter.addParser({id:"roman",is:function(){return!1},format:function(r){var e,i=r.toUpperCase().split(""),a=0;if(!r||!t.test(r))return r;for(;i.length;)a+=(e=n[i.shift()])*(e<n[i[0]]?-1:1);return a},type:"numeric"}),r.tablesorter.addParser({id:"roman-ignore",is:function(){return!1},format:function(i,a,o,s){var u,f,c=a.config,p=r.isArray(c.roman_ignore)?c.roman_ignore[s]:0,m=(isNaN(p)?r.trim(i.replace(p,"")):r.trim(i.substring(0,i.length-p))).match(e),l=0;if(!t.test(m))return i;for(m=(f=m[0]).toUpperCase().split("");m.length;)(u=n[m.shift()])&&(l+=u*(u<n[m[0]]?-1:1));return l?i.replace(f,l):i},type:"text"}),r.tablesorter.addParser({id:"roman-extract",is:function(){return!1},format:function(i){var a,o=r.grep(i.split(/\b/),function(r,e){return t.test(r)?r:""}).join("").match(e),s=0;if(!(o?t.test(o):0))return i;for(o=o[0].toUpperCase().split("");o.length;)(a=n[o.shift()])&&(s+=a*(a<n[o[0]]?-1:1));return s||i},type:"numeric"})}(jQuery);
|
2
dist/js/widgets/widget-columnSelector.min.js
vendored
@ -1,2 +1,2 @@
|
|||||||
/*! Widget: filter, select2 formatter function - updated 7/11/2016 (v2.26.6) */
|
/*! Widget: filter, select2 formatter function - updated 7/11/2016 (v2.26.6) */
|
||||||
!function(e){"use strict";var t=e.tablesorter||{};t.filterFormatter=t.filterFormatter||{},t.filterFormatter.select2=function(l,c,i){var a,n,s=e.extend({cellText:"",match:!0,value:"",multiple:!0,width:"100%"},i),d=l.addClass("select2col"+c).closest("table")[0].config,r=d.widgetOptions,o=e('<input class="filter" type="hidden">').appendTo(l).bind("change"+d.namespace+"filter",function(){var e=v(this.value);d.$table.find(".select2col"+c+" .select2").select2("val",e),g()}),f=d.$headerIndexed[c],p=f.hasClass(r.filter_onlyAvail),u=s.match?"":"^",b=s.match?"":"$",$=r.filter_ignoreCase?"i":"",v=function(e){return e.replace(/^\/\(\^?/,"").replace(/\$\|\^/g,"|").replace(/\$?\)\/i?$/g,"").replace(/\\/g,"").split("|")},g=function(){var t=!1,l=d.$table.find(".select2col"+c+" .select2").select2("val")||s.value||"";e.isArray(l)&&(t=!0,l=l.join("\0")),l=l.replace(/[-[\]{}()*+?.,\/\\^$|#\s]/g,"\\$&"),t&&(l=l.split("\0")),o.val(e.isArray(l)&&l.length&&""!==l.join("")?"/("+u+(l||[]).join(b+"|"+u)+b+")/"+$:"").trigger("search").end().find(".select2").select2("val",l),d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val",l)},h=function(){n=[],a=t.filter.getOptionSource(d.$table[0],c,p)||[],e.each(a,function(e,t){n.push({id:""+t.parsed,text:t.text})}),s.data=n};return f.toggleClass("filter-match",s.match),s.cellText&&l.prepend("<label>"+s.cellText+"</label>"),s.ajax&&!e.isEmptyObject(s.ajax)||s.data||(h(),d.$table.bind("filterEnd",function(){h(),d.$table.find(".select2col"+c).add(d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c)).find(".select2").select2(s)})),e('<input class="select2 select2-'+c+'" type="hidden" />').val(s.value).appendTo(l).select2(s).bind("change",function(){g()}),d.$table.bind("filterFomatterUpdate",function(){var e=v(d.$table.data("lastSearch")[c]||"");(l=d.$table.find(".select2col"+c)).find(".select2").select2("val",e),g(),t.filter.formatterUpdated(l,c)}),d.$table.bind("stickyHeadersInit",function(){var t=d.widgetOptions.$sticky.find(".select2col"+c).empty();e('<input class="select2 select2-'+c+'" type="hidden">').val(s.value).appendTo(t).select2(s).bind("change",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val")),g()}),s.cellText&&t.prepend("<label>"+s.cellText+"</label>")}),d.$table.bind("filterReset",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",s.value||""),setTimeout(function(){g()},0)}),g(),o}}(jQuery);
|
!function(e){"use strict";var t=e.tablesorter||{};t.filterFormatter=t.filterFormatter||{},t.filterFormatter.select2=function(l,c,i){var a,n,s=e.extend({cellText:"",match:!0,value:"",multiple:!0,width:"100%"},i),d=l.addClass("select2col"+c).closest("table")[0].config,r=d.widgetOptions,o=e('<input class="filter" type="hidden">').appendTo(l).bind("change"+d.namespace+"filter",function(){var e=v(this.value);d.$table.find(".select2col"+c+" .select2").select2("val",e),g()}),f=d.$headerIndexed[c],p=f.hasClass(r.filter_onlyAvail),u=s.match?"":"^",b=s.match?"":"$",$=r.filter_ignoreCase?"i":"",v=function(e){return e.replace(/^\/\(\^?/,"").replace(/\$\|\^/g,"|").replace(/\$?\)\/i?$/g,"").replace(/\\/g,"").split("|")},g=function(){var t=!1,l=d.$table.find(".select2col"+c+" .select2").select2("val")||s.value||"";e.isArray(l)&&(t=!0,l=l.join("\0")),l=l.replace(/[-[\]{}()*+?.,/\\^$|#\s]/g,"\\$&"),t&&(l=l.split("\0")),o.val(e.isArray(l)&&l.length&&""!==l.join("")?"/("+u+(l||[]).join(b+"|"+u)+b+")/"+$:"").trigger("search").end().find(".select2").select2("val",l),d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val",l)},h=function(){n=[],a=t.filter.getOptionSource(d.$table[0],c,p)||[],e.each(a,function(e,t){n.push({id:""+t.parsed,text:t.text})}),s.data=n};return f.toggleClass("filter-match",s.match),s.cellText&&l.prepend("<label>"+s.cellText+"</label>"),s.ajax&&!e.isEmptyObject(s.ajax)||s.data||(h(),d.$table.bind("filterEnd",function(){h(),d.$table.find(".select2col"+c).add(d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c)).find(".select2").select2(s)})),e('<input class="select2 select2-'+c+'" type="hidden" />').val(s.value).appendTo(l).select2(s).bind("change",function(){g()}),d.$table.bind("filterFomatterUpdate",function(){var e=v(d.$table.data("lastSearch")[c]||"");(l=d.$table.find(".select2col"+c)).find(".select2").select2("val",e),g(),t.filter.formatterUpdated(l,c)}),d.$table.bind("stickyHeadersInit",function(){var t=d.widgetOptions.$sticky.find(".select2col"+c).empty();e('<input class="select2 select2-'+c+'" type="hidden">').val(s.value).appendTo(t).select2(s).bind("change",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val")),g()}),s.cellText&&t.prepend("<label>"+s.cellText+"</label>")}),d.$table.bind("filterReset",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",s.value||""),setTimeout(function(){g()},0)}),g(),o}}(jQuery);
|
2
dist/js/widgets/widget-filter.min.js
vendored
2
dist/js/widgets/widget-pager.min.js
vendored
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 408 B After Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 346 B |
Before Width: | Height: | Size: 390 B After Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 445 B After Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.2 KiB |
4
docs/css/jquery-ui.min.css
vendored
@ -29,7 +29,11 @@
|
|||||||
$.widget( 'custom.iconselectmenu', $.ui.selectmenu, {
|
$.widget( 'custom.iconselectmenu', $.ui.selectmenu, {
|
||||||
_renderItem: function( ul, item ) {
|
_renderItem: function( ul, item ) {
|
||||||
var hasClass,
|
var hasClass,
|
||||||
li = $( '<li>', { text: item.label } );
|
li = $( '<li>' ),
|
||||||
|
wrapper = $( "<div>", {
|
||||||
|
// empty strings don't work, pass a
|
||||||
|
text: item.label || '\xA0'
|
||||||
|
});
|
||||||
if ( item.disabled ) {
|
if ( item.disabled ) {
|
||||||
li.addClass( 'ui-state-disabled' );
|
li.addClass( 'ui-state-disabled' );
|
||||||
}
|
}
|
||||||
@ -38,8 +42,8 @@
|
|||||||
style : item.element.attr( 'data-style' ),
|
style : item.element.attr( 'data-style' ),
|
||||||
'class' : hasClass ? 'ui-icon ' + item.element.attr( 'data-class' ) : ''
|
'class' : hasClass ? 'ui-icon ' + item.element.attr( 'data-class' ) : ''
|
||||||
})
|
})
|
||||||
.appendTo( li );
|
.appendTo( wrapper );
|
||||||
return li.appendTo( ul );
|
return li.append( wrapper ).appendTo( ul );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -98,6 +102,13 @@
|
|||||||
<em>NOTE!</em>
|
<em>NOTE!</em>
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Updated <span class="version">v2.28.12</span>:
|
||||||
|
<ul>
|
||||||
|
<li>Fix issue with the selectmenu rendering with jQuery UI v1.12.1.</li>
|
||||||
|
<li>Fixed a filter widget issue with regular expression settings being ignored since select filters are set to exactly match the content (modified in <span class="version">v2.25.4</span>)</li>
|
||||||
|
<li><span class="label warning">*NOTE*</span> "filter-match" *must* be added to header since the default select behavior is to exactly match settings and this demo uses a combination of select value using partial matches and regular expressions.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>Demo added <span class="version">v2.24.4</span>, to demonstrate how to use <a href="http://jqueryui.com/selectmenu/#custom_render">jQuery UI Selectmenu widget</a> on a filter row select.</li>
|
<li>Demo added <span class="version">v2.24.4</span>, to demonstrate how to use <a href="http://jqueryui.com/selectmenu/#custom_render">jQuery UI Selectmenu widget</a> on a filter row select.</li>
|
||||||
<li><span class="label warning">*NOTE*</span> - Selectmenu will not work properly in all circumstances:
|
<li><span class="label warning">*NOTE*</span> - Selectmenu will not work properly in all circumstances:
|
||||||
<ul>
|
<ul>
|
||||||
@ -113,7 +124,7 @@
|
|||||||
<table id="table" class="tablesorter">
|
<table id="table" class="tablesorter">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="filter-select">File Name</th>
|
<th class="filter-select filter-match">File Name</th>
|
||||||
<th>Updated</th>
|
<th>Updated</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -477,7 +477,7 @@
|
|||||||
<li>formatter: <a href="example-widget-filter-formatter-1.html">jQuery UI widgets</a> and <a href="example-widget-filter-formatter-2.html">HTML5 Elements</a> (v2.7.7; <span class="version updated">v2.17.5</span>).</li>
|
<li>formatter: <a href="example-widget-filter-formatter-1.html">jQuery UI widgets</a> and <a href="example-widget-filter-formatter-2.html">HTML5 Elements</a> (v2.7.7; <span class="version updated">v2.17.5</span>).</li>
|
||||||
<li>formatter: <a href="example-widget-filter-formatter-select2.html">select2 v3</a> (<span class="version">v2.16.0</span>; <span class="version updated">v2.26.6</span>).</li>
|
<li>formatter: <a href="example-widget-filter-formatter-select2.html">select2 v3</a> (<span class="version">v2.16.0</span>; <span class="version updated">v2.26.6</span>).</li>
|
||||||
<li>formatter: select2 v4 (TO DO)</li>
|
<li>formatter: select2 v4 (TO DO)</li>
|
||||||
<li><a href="example-widget-filter-selectmenu.html">Using jQuery UI Selectmenu</a> (<span class="version">v2.24.4</span>).</li>
|
<li><a href="example-widget-filter-selectmenu.html">Using jQuery UI Selectmenu</a> (<span class="version">v2.24.4</span>; <span class="version updated">v2.28.12</span>).</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><span class="label label-info">Beta</span> <a href="example-widget-formatter.html">Formatter widget</a> (<span class="version">v2.19.1</span>).</li>
|
<li><span class="label label-info">Beta</span> <a href="example-widget-formatter.html">Formatter widget</a> (<span class="version">v2.19.1</span>).</li>
|
||||||
@ -3337,7 +3337,7 @@ $('table').trigger('search', false);</pre></div>
|
|||||||
<td>Function</td>
|
<td>Function</td>
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>
|
<td>
|
||||||
Filter widget: Include a function to return an array of values to be added to the column filter select (<span class="version">v2.16.0</span>; <span class="version updated">v2.24.4</span>).
|
Filter widget: Include a function to return an array of values to be added to the column filter select (<span class="version">v2.16.0</span>; <span class="version updated">v2.28.12</span>).
|
||||||
<div class="collapsible">
|
<div class="collapsible">
|
||||||
<br>
|
<br>
|
||||||
In <span class="version updated">v2.24.4</span>, this option will now accept an array of objects which can contain extra information for each option. Here is an example modified from the <a href="example-widget-filter-selectmenu.html">filter selectmenu demo</a>:
|
In <span class="version updated">v2.24.4</span>, this option will now accept an array of objects which can contain extra information for each option. Here is an example modified from the <a href="example-widget-filter-selectmenu.html">filter selectmenu demo</a>:
|
||||||
@ -3360,6 +3360,12 @@ $('table').trigger('search', false);</pre></div>
|
|||||||
<li><span class="label warning">*NOTE*</span> because this example is providing a fixed select option source, it can not support "filter-onlyAvail" (only show available options after filtering).</li>
|
<li><span class="label warning">*NOTE*</span> because this example is providing a fixed select option source, it can not support "filter-onlyAvail" (only show available options after filtering).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
In <span class="version updated">v2.28.12</span>, return <code>null</code> from a <code>filter_selectSource</code> function to prevent updates to the select options. Useful if you are updating the select options from outside of tablesorter.
|
||||||
|
<pre class="prettyprint lang-js">filter_selectSource : {
|
||||||
|
".filter-select" : function() { return null; }
|
||||||
|
}</pre>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
In <span class="version updated">v2.27.7</span>, an option to have a descending sort applied to this data can be done by adding a <code>"filter-select-sort-desc"</code> to the header cell. Adding a <code>"filter-select-nosort"</code> class name to a header to prevent sorting has been available since v2.16.3.
|
In <span class="version updated">v2.27.7</span>, an option to have a descending sort applied to this data can be done by adding a <code>"filter-select-sort-desc"</code> to the header cell. Adding a <code>"filter-select-nosort"</code> class name to a header to prevent sorting has been available since v2.16.3.
|
||||||
</p>
|
</p>
|
||||||
|
18
docs/js/jquery-ui.min.js
vendored
@ -4,7 +4,7 @@
|
|||||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||||
*/
|
*/
|
||||||
/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/
|
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
|
||||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||||
(function(factory) {
|
(function(factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
}(function(jQuery) {
|
}(function(jQuery) {
|
||||||
|
|
||||||
/*! TableSorter (FORK) v2.28.11 *//*
|
/*! TableSorter (FORK) v2.28.12 *//*
|
||||||
* Client-side table sorting with ease!
|
* Client-side table sorting with ease!
|
||||||
* @requires jQuery v1.2.6+
|
* @requires jQuery v1.2.6+
|
||||||
*
|
*
|
||||||
@ -40,7 +40,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var ts = $.tablesorter = {
|
var ts = $.tablesorter = {
|
||||||
|
|
||||||
version : '2.28.11',
|
version : '2.28.12',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
@ -4079,7 +4079,7 @@
|
|||||||
// change & input events must be ignored if liveSearch !== true
|
// change & input events must be ignored if liveSearch !== true
|
||||||
( eventType === 'change' || eventType === 'input' ) &&
|
( eventType === 'change' || eventType === 'input' ) &&
|
||||||
// prevent search if liveSearch is a number
|
// prevent search if liveSearch is a number
|
||||||
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
|
( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
|
||||||
// don't allow 'change' or 'input' event to process if the input value
|
// don't allow 'change' or 'input' event to process if the input value
|
||||||
// is the same - fixes #685
|
// is the same - fixes #685
|
||||||
this.value !== c.lastSearch[column]
|
this.value !== c.lastSearch[column]
|
||||||
@ -4474,13 +4474,7 @@
|
|||||||
fxn = vars.functions[ columnIndex ];
|
fxn = vars.functions[ columnIndex ];
|
||||||
filterMatched = null;
|
filterMatched = null;
|
||||||
if ( fxn ) {
|
if ( fxn ) {
|
||||||
if ( fxn === true ) {
|
if ( typeof fxn === 'function' ) {
|
||||||
// default selector uses exact match unless 'filter-match' class is found
|
|
||||||
filterMatched = data.isMatch ?
|
|
||||||
// data.iExact may be a number
|
|
||||||
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
|
||||||
data.filter === data.exact;
|
|
||||||
} else if ( typeof fxn === 'function' ) {
|
|
||||||
// filter callback( exact cell content, parser normalized content,
|
// filter callback( exact cell content, parser normalized content,
|
||||||
// filter input value, column index, jQuery row object )
|
// filter input value, column index, jQuery row object )
|
||||||
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
||||||
@ -4499,8 +4493,18 @@
|
|||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
// Look for match, and add child row data for matching
|
// Look for match, and add child row data for matching
|
||||||
} else {
|
} else {
|
||||||
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
// check fxn (filter-select in header) after filter types are checked
|
||||||
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
// without this, the filter + jQuery UI selectmenu demo was breaking
|
||||||
|
if ( fxn === true ) {
|
||||||
|
// default selector uses exact match unless 'filter-match' class is found
|
||||||
|
result = data.isMatch ?
|
||||||
|
// data.iExact may be a number
|
||||||
|
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
||||||
|
data.filter === data.exact;
|
||||||
|
} else {
|
||||||
|
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
||||||
|
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
@ -4800,6 +4804,10 @@
|
|||||||
} else if ( $.type( source ) === 'object' && fxn ) {
|
} else if ( $.type( source ) === 'object' && fxn ) {
|
||||||
// custom select source function for a SPECIFIC COLUMN
|
// custom select source function for a SPECIFIC COLUMN
|
||||||
arry = fxn( table, column, onlyAvail );
|
arry = fxn( table, column, onlyAvail );
|
||||||
|
// abort - updating the selects from an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( arry === false ) {
|
if ( arry === false ) {
|
||||||
// fall back to original method
|
// fall back to original method
|
||||||
@ -4957,6 +4965,10 @@
|
|||||||
// filter_selectSource or column data
|
// filter_selectSource or column data
|
||||||
if ( typeof arry === 'undefined' || arry === '' ) {
|
if ( typeof arry === 'undefined' || arry === '' ) {
|
||||||
arry = tsf.getOptionSource( table, column, onlyAvail );
|
arry = tsf.getOptionSource( table, column, onlyAvail );
|
||||||
|
// abort, selects are updated by an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $.isArray( arry ) ) {
|
if ( $.isArray( arry ) ) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*! TableSorter (FORK) v2.28.11 *//*
|
/*! TableSorter (FORK) v2.28.12 *//*
|
||||||
* Client-side table sorting with ease!
|
* Client-side table sorting with ease!
|
||||||
* @requires jQuery v1.2.6+
|
* @requires jQuery v1.2.6+
|
||||||
*
|
*
|
||||||
@ -22,7 +22,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var ts = $.tablesorter = {
|
var ts = $.tablesorter = {
|
||||||
|
|
||||||
version : '2.28.11',
|
version : '2.28.12',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||||
*/
|
*/
|
||||||
/*! tablesorter (FORK) - updated 05-24-2017 (v2.28.11)*/
|
/*! tablesorter (FORK) - updated 05-26-2017 (v2.28.12)*/
|
||||||
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
|
||||||
(function(factory) {
|
(function(factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
@ -1259,7 +1259,7 @@
|
|||||||
// change & input events must be ignored if liveSearch !== true
|
// change & input events must be ignored if liveSearch !== true
|
||||||
( eventType === 'change' || eventType === 'input' ) &&
|
( eventType === 'change' || eventType === 'input' ) &&
|
||||||
// prevent search if liveSearch is a number
|
// prevent search if liveSearch is a number
|
||||||
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
|
( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
|
||||||
// don't allow 'change' or 'input' event to process if the input value
|
// don't allow 'change' or 'input' event to process if the input value
|
||||||
// is the same - fixes #685
|
// is the same - fixes #685
|
||||||
this.value !== c.lastSearch[column]
|
this.value !== c.lastSearch[column]
|
||||||
@ -1654,13 +1654,7 @@
|
|||||||
fxn = vars.functions[ columnIndex ];
|
fxn = vars.functions[ columnIndex ];
|
||||||
filterMatched = null;
|
filterMatched = null;
|
||||||
if ( fxn ) {
|
if ( fxn ) {
|
||||||
if ( fxn === true ) {
|
if ( typeof fxn === 'function' ) {
|
||||||
// default selector uses exact match unless 'filter-match' class is found
|
|
||||||
filterMatched = data.isMatch ?
|
|
||||||
// data.iExact may be a number
|
|
||||||
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
|
||||||
data.filter === data.exact;
|
|
||||||
} else if ( typeof fxn === 'function' ) {
|
|
||||||
// filter callback( exact cell content, parser normalized content,
|
// filter callback( exact cell content, parser normalized content,
|
||||||
// filter input value, column index, jQuery row object )
|
// filter input value, column index, jQuery row object )
|
||||||
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
||||||
@ -1679,8 +1673,18 @@
|
|||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
// Look for match, and add child row data for matching
|
// Look for match, and add child row data for matching
|
||||||
} else {
|
} else {
|
||||||
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
// check fxn (filter-select in header) after filter types are checked
|
||||||
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
// without this, the filter + jQuery UI selectmenu demo was breaking
|
||||||
|
if ( fxn === true ) {
|
||||||
|
// default selector uses exact match unless 'filter-match' class is found
|
||||||
|
result = data.isMatch ?
|
||||||
|
// data.iExact may be a number
|
||||||
|
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
||||||
|
data.filter === data.exact;
|
||||||
|
} else {
|
||||||
|
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
||||||
|
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
@ -1980,6 +1984,10 @@
|
|||||||
} else if ( $.type( source ) === 'object' && fxn ) {
|
} else if ( $.type( source ) === 'object' && fxn ) {
|
||||||
// custom select source function for a SPECIFIC COLUMN
|
// custom select source function for a SPECIFIC COLUMN
|
||||||
arry = fxn( table, column, onlyAvail );
|
arry = fxn( table, column, onlyAvail );
|
||||||
|
// abort - updating the selects from an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( arry === false ) {
|
if ( arry === false ) {
|
||||||
// fall back to original method
|
// fall back to original method
|
||||||
@ -2137,6 +2145,10 @@
|
|||||||
// filter_selectSource or column data
|
// filter_selectSource or column data
|
||||||
if ( typeof arry === 'undefined' || arry === '' ) {
|
if ( typeof arry === 'undefined' || arry === '' ) {
|
||||||
arry = tsf.getOptionSource( table, column, onlyAvail );
|
arry = tsf.getOptionSource( table, column, onlyAvail );
|
||||||
|
// abort, selects are updated by an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $.isArray( arry ) ) {
|
if ( $.isArray( arry ) ) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Widget: columnSelector (responsive table widget) - updated 12/15/2016 (v2.28.2) *//*
|
/* Widget: columnSelector (responsive table widget) - updated 5/25/2017 (v2.28.12) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Justin Hallett & Rob Garrison
|
* by Justin Hallett & Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -541,9 +541,9 @@
|
|||||||
},
|
},
|
||||||
remove: function(table, c, wo, refreshing) {
|
remove: function(table, c, wo, refreshing) {
|
||||||
var csel = c.selector;
|
var csel = c.selector;
|
||||||
if ( csel) { csel.$container.empty(); }
|
|
||||||
if ( refreshing || !csel ) { return; }
|
if ( refreshing || !csel ) { return; }
|
||||||
if (csel.$popup) { csel.$popup.empty(); }
|
if ( csel ) { csel.$container.empty(); }
|
||||||
|
if ( csel.$popup ) { csel.$popup.empty(); }
|
||||||
csel.$style.remove();
|
csel.$style.remove();
|
||||||
csel.$breakpoints.remove();
|
csel.$breakpoints.remove();
|
||||||
$( c.namespace + 'columnselectorHasSpan' ).removeClass( wo.filter_filteredRow || 'filtered' );
|
$( c.namespace + 'columnselectorHasSpan' ).removeClass( wo.filter_filteredRow || 'filtered' );
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
$table = c.$table,
|
$table = c.$table,
|
||||||
$attach = $(wo.cssStickyHeaders_attachTo),
|
$attach = $(wo.cssStickyHeaders_attachTo),
|
||||||
// target all versions of IE
|
// target all versions of IE
|
||||||
isIE = 'ActiveXObject' in window || window.navigator.userAgent.indexOf("Edge") > -1,
|
isIE = 'ActiveXObject' in window || window.navigator.userAgent.indexOf('Edge') > -1,
|
||||||
namespace = c.namespace + 'cssstickyheader ',
|
namespace = c.namespace + 'cssstickyheader ',
|
||||||
$thead = $table.children('thead'),
|
$thead = $table.children('thead'),
|
||||||
$caption = $table.children('caption'),
|
$caption = $table.children('caption'),
|
||||||
|
@ -849,7 +849,7 @@
|
|||||||
// change & input events must be ignored if liveSearch !== true
|
// change & input events must be ignored if liveSearch !== true
|
||||||
( eventType === 'change' || eventType === 'input' ) &&
|
( eventType === 'change' || eventType === 'input' ) &&
|
||||||
// prevent search if liveSearch is a number
|
// prevent search if liveSearch is a number
|
||||||
( liveSearch === true || liveSearch !== true && event.target.nodeName !== "INPUT" ) &&
|
( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
|
||||||
// don't allow 'change' or 'input' event to process if the input value
|
// don't allow 'change' or 'input' event to process if the input value
|
||||||
// is the same - fixes #685
|
// is the same - fixes #685
|
||||||
this.value !== c.lastSearch[column]
|
this.value !== c.lastSearch[column]
|
||||||
@ -1244,13 +1244,7 @@
|
|||||||
fxn = vars.functions[ columnIndex ];
|
fxn = vars.functions[ columnIndex ];
|
||||||
filterMatched = null;
|
filterMatched = null;
|
||||||
if ( fxn ) {
|
if ( fxn ) {
|
||||||
if ( fxn === true ) {
|
if ( typeof fxn === 'function' ) {
|
||||||
// default selector uses exact match unless 'filter-match' class is found
|
|
||||||
filterMatched = data.isMatch ?
|
|
||||||
// data.iExact may be a number
|
|
||||||
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
|
||||||
data.filter === data.exact;
|
|
||||||
} else if ( typeof fxn === 'function' ) {
|
|
||||||
// filter callback( exact cell content, parser normalized content,
|
// filter callback( exact cell content, parser normalized content,
|
||||||
// filter input value, column index, jQuery row object )
|
// filter input value, column index, jQuery row object )
|
||||||
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
|
||||||
@ -1269,8 +1263,18 @@
|
|||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
// Look for match, and add child row data for matching
|
// Look for match, and add child row data for matching
|
||||||
} else {
|
} else {
|
||||||
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
// check fxn (filter-select in header) after filter types are checked
|
||||||
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
// without this, the filter + jQuery UI selectmenu demo was breaking
|
||||||
|
if ( fxn === true ) {
|
||||||
|
// default selector uses exact match unless 'filter-match' class is found
|
||||||
|
result = data.isMatch ?
|
||||||
|
// data.iExact may be a number
|
||||||
|
( '' + data.iExact ).search( data.iFilter ) >= 0 :
|
||||||
|
data.filter === data.exact;
|
||||||
|
} else {
|
||||||
|
txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
|
||||||
|
result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result = filterMatched;
|
result = filterMatched;
|
||||||
@ -1570,6 +1574,10 @@
|
|||||||
} else if ( $.type( source ) === 'object' && fxn ) {
|
} else if ( $.type( source ) === 'object' && fxn ) {
|
||||||
// custom select source function for a SPECIFIC COLUMN
|
// custom select source function for a SPECIFIC COLUMN
|
||||||
arry = fxn( table, column, onlyAvail );
|
arry = fxn( table, column, onlyAvail );
|
||||||
|
// abort - updating the selects from an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( arry === false ) {
|
if ( arry === false ) {
|
||||||
// fall back to original method
|
// fall back to original method
|
||||||
@ -1727,6 +1735,10 @@
|
|||||||
// filter_selectSource or column data
|
// filter_selectSource or column data
|
||||||
if ( typeof arry === 'undefined' || arry === '' ) {
|
if ( typeof arry === 'undefined' || arry === '' ) {
|
||||||
arry = tsf.getOptionSource( table, column, onlyAvail );
|
arry = tsf.getOptionSource( table, column, onlyAvail );
|
||||||
|
// abort, selects are updated by an external method
|
||||||
|
if (arry === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $.isArray( arry ) ) {
|
if ( $.isArray( arry ) ) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tablesorter",
|
"name": "tablesorter",
|
||||||
"title": "tablesorter",
|
"title": "tablesorter",
|
||||||
"version": "2.28.11",
|
"version": "2.28.12",
|
||||||
"description": "tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.",
|
"description": "tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Christian Bach",
|
"name": "Christian Bach",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tablesorter",
|
"name": "tablesorter",
|
||||||
"title": "tablesorter",
|
"title": "tablesorter",
|
||||||
"version": "2.28.11",
|
"version": "2.28.12",
|
||||||
"description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.",
|
"description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Christian Bach",
|
"name": "Christian Bach",
|
||||||
|
@ -391,7 +391,7 @@ jQuery(function($){
|
|||||||
ts = this.ts,
|
ts = this.ts,
|
||||||
$table = this.$table,
|
$table = this.$table,
|
||||||
table = this.table;
|
table = this.table;
|
||||||
assert.expect(3);
|
assert.expect(4);
|
||||||
|
|
||||||
return QUnit.SequentialRunner(
|
return QUnit.SequentialRunner(
|
||||||
function(actions, assertions) {
|
function(actions, assertions) {
|
||||||
@ -400,10 +400,14 @@ jQuery(function($){
|
|||||||
).nextTask(
|
).nextTask(
|
||||||
function(){ ts.setFilters( table, ['abc 1'] ); },
|
function(){ ts.setFilters( table, ['abc 1'] ); },
|
||||||
function(){ assert.cacheCompare( table, 0, ['abc 1'], 'select exact search', true ); }
|
function(){ assert.cacheCompare( table, 0, ['abc 1'], 'select exact search', true ); }
|
||||||
|
).nextTask(
|
||||||
|
function(){ ts.setFilters( table, ['/abc\\s1$/'] ); },
|
||||||
|
function(){ assert.cacheCompare( table, 0, ['abc 1'], 'select exact search using regex', true ); }
|
||||||
).nextTask(
|
).nextTask(
|
||||||
function(){
|
function(){
|
||||||
$table.find( '.filter-select' ).eq(0).addClass( 'filter-match' );
|
$table.find( '.filter-select' ).eq(0).addClass( 'filter-match' );
|
||||||
ts.setFilters( table, [ 'abc 1' ] ); },
|
ts.setFilters( table, [ 'abc 1' ] );
|
||||||
|
},
|
||||||
function(){ assert.cacheCompare( table, 0, ['abc 1', 'abc 11', 'ABC 10'], 'select match search', true ); }
|
function(){ assert.cacheCompare( table, 0, ['abc 1', 'abc 11', 'ABC 10'], 'select match search', true ); }
|
||||||
).nextTask(
|
).nextTask(
|
||||||
function(){ ts.setFilters( table, ['', '1'] ); },
|
function(){ ts.setFilters( table, ['', '1'] ); },
|
||||||
|