set global search value to a parameter in the url

set global search value to a parameter in the url

ccaajoaccaajoa Posts: 4Questions: 0Answers: 0
edited October 2010 in General
If for example the url to the page that contains the data table is www.some.url/?search=apples is it possible to display the string apples in the search box. I've worked out that I can use fnFilter to set the default filter but I'd like the text to also be displayed in the global search input.
Many thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You can use oSearch to set the initial search string: http://datatables.net/usage/options#oSearch , and then all you need to do is get the search string from the window.location.href string.

    Allan
  • ccaajoaccaajoa Posts: 4Questions: 0Answers: 0
    Thanks, that worked
This discussion has been closed.