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/searchHighlight/dataTables.searchHighlight....

2 lines
940 B
JavaScript

/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function highlight(t,i){t.unhighlight(),i.rows({filter:"applied"}).data().length&&(i.columns().every(function(){var t=this;t.nodes().flatten().to$().unhighlight({className:"column_highlight"}),t.nodes().flatten().to$().highlight(t.search().trim().split(/\s+/),{className:"column_highlight"})}),t.highlight(i.search().trim().split(/\s+/)))}$(document).on("init.dt.dth",function(t,i,h){var a,e;"dt"===t.namespace&&(a=new DataTable.Api(i),e=$(a.table().body()),$(a.table().node()).hasClass("searchHighlight")||i.oInit.searchHighlight||DataTable.defaults.searchHighlight)&&(a.on("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",function(){highlight(e,a)}).on("destroy",function(){a.off("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth")}),a.search())&&highlight(e,a)});export default DataTable;