How can I autofill the searchfield?

How can I autofill the searchfield?

envyenvy Posts: 4Questions: 0Answers: 0
edited July 2013 in General
Hello community,

I am looking for a solution to autofill the "Search field" with a "onclick event". As I am not really deep in java and html, I am asking for a solution here.

I have 10 keywords above my datatable. When I click on one keyword i want to filter it in the table. My solution would be

onclick= "div.dataTables_filter input:Keyword" but it does not work.

Thank you in advance.

Tobi

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Use the fnFilter method. It will automatically fill in the input box.

    Allan
  • envyenvy Posts: 4Questions: 0Answers: 0
    edited July 2013
    Thank you. It works fine :)

    Is it also possible to make external search links?

    What means, the link is on page 1 (index.htm) the datatable is on page 2 (tools.htm). When I click on a link on page 1 I want to open page 2 with oTable.fnFilter('Keyword');
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Not built into DataTables, but no reason why you couldn't use a few lines of script to do it.

    Allan
This discussion has been closed.