Highlighting search and stateSave: true
Highlighting search and stateSave: true
Hi everybody,
I have a problem with hightlighting search results and stateSave = true.
I've used a solution of this thread http://datatables.net/forums/discussion/2123/filter-post-processing-and-highlighting/p2
To show you the problem I've created a small example http://jsfiddle.net/tc1ryoah/1/ (tested with Chrome and FF with Firebug).
Please try to search something (result is highlighted) and run the example again -> no highlighting.
If you then perform any further action like sorting or page navigation, highlighting works again.
Any ideas where the problem could be (callback not triggered, order of initialisation ...)?
Replies
The thread you linked to is from 2012 which is long before the introduction of the search highlighting plug-in.
You might be interested in this pull request which addresses the issue you are seeing. I need to merge that change in.
Allan
Hi allan,
thank you for your quick answer, I haven't seen yet, that there is a separate plugin for this.
I will try this and also the pull request you've mentioned.
I've just updated the search highlighting plug-in for DataTables to add support for state saving and initial filters. The latest version of the file is available in git and will be released to the DataTables CDN in the next few weeks.
Allan
Highlighting after refreshing the page works now.
Another action after that highlighting doesn't work is ColReorder.
I've added following code to highlight plugin now which works for me at the moment.
If somebody has other ideas, please let me know.
I would suggest a much more simple change, which is just to listen for the
column-reorder
event on the DataTable in question. I've committed that here.Thanks,
Allan
Thank you, works perfectly.
Do I need full forum access to accept an answer?
No - the post was opened as a discussion rather than a question, so there are no "Answers" as such. But that's fine - we'll just leave it like this :-)
Allan