How can I put the value in the search bar?
How can I put the value in the search bar?
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
Is this with SearchBuilder? If so, use
searchBuilder.preDefined
to set up the condition you want at start up time.Allan
@allan
Actually It's not.
The Input Search Bar is yours, but the dropdown-menus are made by my own..
Just calling
search()
will put the search string into that search bar automatically.Colin
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