Highlight search box when there's value
Highlight search box when there's value

When using the search box option, is there a way to highlight the box when there's a value in it? Cases would include when the box starts off empty and someone then types something in, or when state saving is on and someone previously typed something in such that the box comes pre-filled.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I would look at using the
search
event andstateLoaded
callback to get the search term then add or remove the highlight class to the search input as appropriate.Kevin
Actually the search input hasn't been created when
stateLoaded
runs. UseinitComplete
instead. Here is an example:http://live.datatables.net/xumubeja/1/edit
Kevin
That's perfect! Thank you, again, for your help!