I have implemented a tableView with a searchBar added to it.
I want to call a service when user start typing the search keyword in the search bar. I know that I can call the service in the change event listener that will call the service.
The problem I am facing is that for every change in the search bar It is not good to call a service. So what is the efficient approach of using search bar when the search result is coming from a service call or what we can do to make the search efficient.
For example: the search functionality on Apple's App store
2 Answers
Accepted Answer
Then you need to use the change event. If you would like to call the service once you have types in x amount oof characters you can check the length of the input string before calling the service.
Ajeet,
Try to call webservice in return event listener like..
var search = Titanium.UI.createSearchBar({ top : 0, height : 44, hintText : "Search", barColor : '#dedede', }); win.add(search); search.addEventListener('return', function(e) { // function() });
Your Answer
Think you can help? Login to answer this question!