You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
2 years ago
|
/*! © SpryMedia Ltd - datatables.net/license */
|
||
|
import $ from"jquery";import DataTable from"datatables.net";function _draw(e,a){a.empty(),a.append("Search: "),$('<input type="text" class="searchFadeInput'+e.settings()[0].sTableId+'">').appendTo(a)}DataTable.Api.register("searchFade()",function(){return this}),DataTable.Api.register("searchFade().node()",function(){return this.settings()[0].searchFadeNode}),DataTable.SearchFade=function(e){var i=new DataTable.Api(e),a=$('<div class="searchFade"/>');i.settings()[0].searchFadeNode=a,_draw(i,a),a.on("keyup redraw","input",function(){i.rows(":visible").every(function(e,a,t){var n=!0,r=$(".searchFadeInput"+i.settings()[0].sTableId).val();r.length&&(n=i.row(e).data().some(function(e){return null!=e.match(new RegExp(r,"i"))})),$(i.row(e).node()).toggleClass("notMatched",!n)})}),i.on("draw",function(){$("input",a).trigger("redraw")}),this.node=function(){return a}},DataTable.ext.feature.push({fnInit:function(e){return new DataTable.SearchFade(e).node()},cFeature:"F"}),$(document).on("init.dt",function(e,a){"dt"===e.namespace&&(a.oInit.searchFade||DataTable.defaults.searchFade)&&DataTable.SearchFade(a)});export default DataTable;
|