How can I put the value in the search bar?

How can I put the value in the search bar?

solsol Posts: 18Questions: 7Answers: 0

Hi, all

I have two questions.

First, I want to put the value directly into the search bar.
Is it possible?

Second, I think the default of searching condition is based on the logical operator OR.
Is there a way to change it AND?

I made two dropdown-menus to search the rows by key-value format.

Actually, F is the key and G is the value, and combined F and G to search in column E.
And when user selected key or value, I would like to put that into the search bar.

I'm afraid my explanation isn't enough..
Please tell me if you want more explanation.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Is this with SearchBuilder? If so, use searchBuilder.preDefined to set up the condition you want at start up time.

    Allan

  • solsol Posts: 18Questions: 7Answers: 0

    @allan
    Actually It's not.
    The Input Search Bar is yours, but the dropdown-menus are made by my own..

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Just calling search() will put the search string into that search bar automatically.

    Colin

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Answer ✓

    Additionally, DataTables search is AND based. You could use regex to get an OR based search, but it isn't all that user friendly. Your best bet, if you want OR based filtering would be to create a filtering plug-in for it.

    Allan

Sign In or Register to comment.