diff --git a/features/searchPane/dataTables.searchPane.js b/features/searchPane/dataTables.searchPane.js index 125c69d..66af76c 100644 --- a/features/searchPane/dataTables.searchPane.js +++ b/features/searchPane/dataTables.searchPane.js @@ -111,7 +111,7 @@ var d = data[i]; if (!d) { - return; + continue; } if (!out[d]) { @@ -343,12 +343,12 @@ return this.iterator('column', function(ctx, idx) { var col = ctx.aoColumns[idx]; - if (ctx.searchPane) { - if (!col.searchPane) { - col.searchPane = {}; - } + if (!col.searchPane) { + col.searchPane = {}; + } + col.searchPane.options = options; - col.searchPane.options = options; + if (ctx.searchPane) { ctx.searchPane.rebuild(); } }); diff --git a/features/searchPane/dataTables.searchPane.min.js b/features/searchPane/dataTables.searchPane.min.js index e63d60b..82f0d2a 100644 --- a/features/searchPane/dataTables.searchPane.min.js +++ b/features/searchPane/dataTables.searchPane.min.js @@ -17,10 +17,10 @@ $jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"un $jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6-impl","es3"); (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(f){return a(f,window,document)}):"object"===typeof exports?module.exports=function(f,c){f||(f=window);c&&c.fn.dataTable||(c=require("datatables.net")(f,c).$);return a(c,f,f.document)}:a(jQuery,window,document)})(function(a,f,c,g){function d(b,h){var e=this;b=new k.Api(b);this.classes=a.extend(!0,{},d.classes);this.dom={container:a("
").addClass(this.classes.container)};this.c=a.extend(!0,{},d.defaults, h);this.s={dt:b};b.settings()[0].searchPane=this;b.columns(this.c.columns).eq(0).each(function(a){e._pane(a)});a(this.dom.container).on("click","li",function(){e._toggle(this)}).on("click","button."+this.classes.clear,function(){e._clear(a(this).closest("div."+e.classes.pane.container))});this._attach()}var k=a.fn.dataTable;a.extend(d.prototype,{rebuild:function(){var a=this;this.s.dt.columns(this.c.columns).eq(0).each(function(b){a._pane(b)})},_attach:function(){var b=this.c.container,b="function"=== -typeof b?b(this.s.dt):b;"prepend"===this.c.insert?a(this.dom.container).prependTo(b):a(this.dom.container).appendTo(b)},_binData:function(a){for(var b={},e=0,c=a.length;e"),d=l.options?new k.Api(null,l.options):c.data(),l=this._binData(d.flatten());if(!(this._variance(l)").html(''+d[g]+"").data("filter",d[g]).append(a("").addClass(e.count).html(l[d[g]]));if(m.length){var q=d[g].replace?a.fn.dataTable.util.escapeRegex(d[g]):d[g];-1!==a.inArray(q,m)&&n.addClass(e.selected)}f.append(n)}e= +typeof b?b(this.s.dt):b;"prepend"===this.c.insert?a(this.dom.container).prependTo(b):a(this.dom.container).appendTo(b)},_binData:function(a){for(var b={},e=0,c=a.length;e"), +d=l.options?new k.Api(null,l.options):c.data(),l=this._binData(d.flatten());if(!(this._variance(l)").html(''+d[g]+"").data("filter",d[g]).append(a("").addClass(e.count).html(l[d[g]]));if(m.length){var q=d[g].replace?a.fn.dataTable.util.escapeRegex(d[g]):d[g];-1!==a.inArray(q,m)&&n.addClass(e.selected)}f.append(n)}e= a("
").data("column",b).addClass(h.container).addClass(m.length?h.active:"").append(a('').addClass(this.classes.clear)).append(a("
").addClass(h.title).html(a(c.header()).text())).append(a("
").addClass(h.scroller).append(f));h=this.dom.container;c=h.children().map(function(){if(a(this).data("column")==b)return this});c.length?c.replaceWith(e):a(h).append(e)}},_getOptions:function(a){return this.s.dt.settings()[0].aoColumns[a].searchPane||{}},_toggle:function(b){var d= this.classes,e=d.item.selected,c=this.s.dt;b=a(b);var f=b.closest("div."+d.pane.container),g=f.data("column"),k=this._getOptions(g);b.toggleClass(e,!b.hasClass(e));b=f.find("li."+e);0===b.length?(f.removeClass(d.pane.active),c.column(g).search("").draw()):"any"===k.match?(f.addClass(d.pane.active),c.column(g).search("("+a.map(b,function(b){b=a(b).data("filter").toString();return a.fn.dataTable.util.escapeRegex(b)}).join("|")+")",!0,!1).draw()):(f.addClass(d.pane.active),c.column(g).search("^("+a.map(b, function(b){b=a(b).data("filter").toString();return a.fn.dataTable.util.escapeRegex(b)}).join("|")+")$",!0,!1).draw())},_variance:function(b){b=a.map(b,function(a,b){return a});for(var d=b.length,e=0,c=0,f=d;c