Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to use search control without a button, as user types ...

Hi Joe,

It depends on what query you want to create. Could you please show an example of data and desired result?

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

How to use search control without a button, as user types ...

Katya,

No problem. Assume all the same circumstances discussed earlier. Everything is the same, but I want to search four columns instead of just one. All the data being searched is in string format.

example:
I have four columns in my database with string data.
I want to search the data in the columns using a search bar.
I want the response to display in a grid.
I want to be able to search any keyword from any of the columns in the search, if possible.

This code searches one column name in the query service request where parameter:
return '{"column1_name":{"$regex":"^'+value+'", "$options":"i"}}';

How do I edit the above js code to search all four columns?

Let me know if more illustration is needed.

Thanks again,
Joe

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to use search control without a button, as user types ...

Joe,

You can use $or for sample from different columns, for example:pre{"$or":[{"my":"1"},{"my2":"2"}]}/prereturns all the records with my=1 or my2=2. Then you can change the condition.

Joe6207668
Posts: 0
Joined: Wed Sep 04, 2013 6:24 pm

How to use search control without a button, as user types ...

Katya you are awesome!

Thanks so much for all your continued help!

Joe

Scott Schechtel6280324
Posts: 0
Joined: Sun Sep 29, 2013 12:03 am

How to use search control without a button, as user types ...

maryna, can the search component work with a database? For example, can I use that component instead of the input/button component combo to query from a db?

Thanks

Scott Schechtel6280324
Posts: 0
Joined: Sun Sep 29, 2013 12:03 am

How to use search control without a button, as user types ...

and if so can I follow this tutorial and just incorporate the search component where the input/button are: http://docs.appery.io/tutorials/build...

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

How to use search control without a button, as user types ...

Followed the steps above to get the search working on my app. If I want to search for something called "Lion" is it possible to be getting results when just an "L" is typed instead of when the whole word is there?

Return to “Issues”