I would like to be able to make a link to a page with a datatable which would pass a search parameter value in the url. The goal is to have the page with the datatable open pre-filtered with the search value parameter.
I've set up a jsfiddle to work in with some sample data.
http://jsfiddle.net/lbriquet/9CxYT/10/
The idea would be to add a parameter to the jsfiddle url so that the page would display with the search input value set to "firefox", for example, and the table filtered to show only the search matches.
Any help would be really appreciated!!
This is an old question, but it still pops up high when searching for a solution. Here's what I did to make it work.
Here is what I did to get it to work:
The first part from @Ibriquet gets the GET parameters from the url, I didn't change that. Quite possibly there is a nicer way to do this, but I didn't research that.
For the second part I included this within the
$('#tablename').DataTable( { here, right after the column setup }
This puts anything after the ?search= and before any & in your url into the search field.
You could simply have a function that reads your URL var and then filter the table. I imagine that you pass q=Firefox as your search
Fiddle here http://fiddle.jshell.net/9CxYT/17/show/?q=Firefox