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.
Plugins/features/excludeSearch/dataTables.excludeSearch.mi...

2 lines
891 B
JavaScript

/*! © Ulises Gomez / Gravity Lending, SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("excludeSearch()",function(a){return this.iterator("table",function(e){e.exclude_search=a}),this}),DataTable.ext.search.push(function(a,e){if(""===a.exclude_search||void 0===a.exclude_search||null===a.exclude_search)return!0;let t=!0;return e.forEach(e=>{e.toUpperCase().includes(a.exclude_search.toUpperCase())&&(t=!1)}),t}),DataTable.ExcludeSearch=function(e){let a=new DataTable.Api(e),t=$('<div class="mx-3 dataTables_filter"><label>Exclude: </label><input type="text" /></div>');t.find("input").on("input",function(){a.excludeSearch($(this).val()).draw()}),this.node=function(){return t}},DataTable.ext.feature.push({fnInit:function(e){return new DataTable.ExcludeSearch(e).node()},cFeature:"X"});export default DataTable;