Page 2 of 3

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

Posted: Wed Nov 20, 2013 5:23 pm
by Kateryna Grynko

Hi Joe,

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


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

Posted: Wed Nov 20, 2013 5:58 pm
by Joe6207668

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


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

Posted: Wed Nov 20, 2013 6:49 pm
by Kateryna Grynko

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.


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

Posted: Wed Nov 20, 2013 7:35 pm
by Joe6207668

Katya you are awesome!

Thanks so much for all your continued help!

Joe


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

Posted: Thu Dec 12, 2013 8:46 pm
by Scott Schechtel6280324

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


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

Posted: Thu Dec 12, 2013 9:17 pm
by Maryna Brodina

Hello! Yes, you can.


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

Posted: Thu Dec 12, 2013 9:22 pm
by Scott Schechtel6280324

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...


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

Posted: Thu Dec 12, 2013 9:36 pm
by Maryna Brodina

Yes


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

Posted: Fri Nov 21, 2014 5:02 am
by Ellen Schlechter

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?


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

Posted: Fri Nov 21, 2014 4:22 pm
by Maryna Brodina

Hello!

Use regular expressions for this http://devcenter.appery.io/documentat...