Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82109

Adding parameters to a URL to "pre-filter"

$
0
0
Sorry I am going to use the wrong lingo I'm sure, but what I'm trying to do is create links that have parameters in the URL that will take me to my table and have the search field already filled in with the parameter.

example: http://mysite.com/list/?search=ABC

I'd want that link to take me to my table that lives at http://mysite.com/list/ and have the search box already filled in with "ABC" in it. I got as far as finding this code, which worked, but it's a hardcoded search and I want it to be a variable controlled via the URL.

$(document).ready( function() {
  $('#example').dataTable( {
    "oSearch": {"sSearch": "Initial search"}
  } );
} )

Here is my live example of my current code: http://live.datatables.net/etigif/3/edit

Any help would be greatly appreciated!

Viewing all articles
Browse latest Browse all 82109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>