From abbc50179ff6947cdc6a27a20dc591f633182521 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 23 Jan 2015 09:29:59 +0000 Subject: [PATCH] Search highlight: Add ColReorder support --- features/searchHighlight/dataTables.searchHighlight.js | 4 ++-- features/searchHighlight/dataTables.searchHighlight.min.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/searchHighlight/dataTables.searchHighlight.js b/features/searchHighlight/dataTables.searchHighlight.js index 4379afb..6218c12 100644 --- a/features/searchHighlight/dataTables.searchHighlight.js +++ b/features/searchHighlight/dataTables.searchHighlight.js @@ -58,12 +58,12 @@ $(document).on( 'init.dt.dth', function (e, settings, json) { $.fn.dataTable.defaults.searchHighlight // default set ) { table - .on( 'draw.dt.dth column-visibility.dt.dth', function () { + .on( 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth', function () { highlight( body, table ); } ) .on( 'destroy', function () { // Remove event handler - table.off( 'draw.dt.dth column-visibility.dt.dth' ); + table.off( 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth' ); } ); // initial highlight for state saved conditions and initial states diff --git a/features/searchHighlight/dataTables.searchHighlight.min.js b/features/searchHighlight/dataTables.searchHighlight.min.js index 1a926af..bfbc569 100644 --- a/features/searchHighlight/dataTables.searchHighlight.min.js +++ b/features/searchHighlight/dataTables.searchHighlight.min.js @@ -2,5 +2,5 @@ SearchHighlight for DataTables v1.0.1 2014 SpryMedia Ltd - datatables.net/license */ -(function(g,d,a){function e(a,c){a.unhighlight();c.rows({filter:"applied"}).data().length&&a.highlight(c.search().split(" "))}a(d).on("init.dt.dth",function(d,c){var b=new a.fn.dataTable.Api(c),f=a(b.table().body());if(a(b.table().node()).hasClass("searchHighlight")||c.oInit.searchHighlight||a.fn.dataTable.defaults.searchHighlight)b.on("draw.dt.dth column-visibility.dt.dth",function(){e(f,b)}).on("destroy",function(){b.off("draw.dt.dth column-visibility.dt.dth")}),b.search()&&e(f,b)})})(window,document, -jQuery); +(function(g,d,a){function e(a,c){a.unhighlight();c.rows({filter:"applied"}).data().length&&a.highlight(c.search().split(" "))}a(d).on("init.dt.dth",function(d,c){var b=new a.fn.dataTable.Api(c),f=a(b.table().body());if(a(b.table().node()).hasClass("searchHighlight")||c.oInit.searchHighlight||a.fn.dataTable.defaults.searchHighlight)b.on("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",function(){e(f,b)}).on("destroy",function(){b.off("draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth")}), +b.search()&&e(f,b)})})(window,document,jQuery);