Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have search functionality in android using phonegap?

I developed an application which contains a large list of different users with their name and id. Now I want to perform a search functionality so that I can search for a particular user using their name or id.

Can anyone help me in achieving this using Phonegap?

Details:

I am getting the list of usernames from json webservice call and I want to perform search operation for those.

For example I have android tablet application which contains 3 list views with almost 40 different user names and on the top of that page I have a search bar. In that search bar if I enter a username or id it should search for the entered data and direct me to there.

like image 689
android phonegap Avatar asked Jun 06 '12 05:06

android phonegap


1 Answers

I have put a listview example in following fiddle and use the filtertext attribute to search on multiple data. See if this fits in your solution.

http://jsfiddle.net/dhavaln/HZg5J/

Edit

The fiddle now also includes the filter callback option provided by the jQuery Mobile to customize the response.

like image 170
dhaval Avatar answered Oct 20 '22 18:10

dhaval