Mihai Das
Posts: 0
Joined: Thu May 07, 2015 7:30 pm

real time search in database

Hi,
I need to make an mobile app the will search in the database some records.
but I need to be real time search, no with search button.
so i input some letter and the app show me 10 records that match with the requested letters.
do you have some documents.
thanks
Mihai

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

real time search in database

Add an input 'search box' to your UI, and then build a where clause in the 'on value change event'.... In this event save the where clause to a local storage variable, and then call the service to get rows from your collection ... In that event ... Servicename.execute() of course in that service you need to use the where clause you built in localstorage as the mapped where clause ..

Hint: call building the where clause based on the length of the input in the search box . Appery('yourinputfieldname').val().length ... Test to see say that it's either 1 or 4 or 7 etc ( your call on when to trigger the search )...with some math function to determine if there is no remainder, etc.

Return to “Issues”