Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4D0D89E38 for ; Mon, 28 Nov 2011 22:48:04 +0000 (UTC) Received: (qmail 37605 invoked by uid 500); 28 Nov 2011 22:48:04 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 37582 invoked by uid 500); 28 Nov 2011 22:48:04 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 37573 invoked by uid 99); 28 Nov 2011 22:48:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 22:48:04 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 22:48:01 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F39ABA4F0E for ; Mon, 28 Nov 2011 22:47:40 +0000 (UTC) Date: Mon, 28 Nov 2011 22:47:40 +0000 (UTC) From: "Shazron Abdullah (Created) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1607321849.20030.1322520460999.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CB-58) Feature request: contacts.find API too slow for autocomplete. provide max contact objects option. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Feature request: contacts.find API too slow for autocomplete. provide max contact objects option. ------------------------------------------------------------------------------------------------- Key: CB-58 URL: https://issues.apache.org/jira/browse/CB-58 Project: Apache Callback Issue Type: New Feature Components: iOS Reporter: Shazron Abdullah reported at: https://github.com/phonegap/phonegap-iphone/issues/56 by: https://github.com/hardeep I am trying to use the contacts.find api to fill in an autocomplete box. It is too slow to be useful in this context. Please provide a way to limit the number of contact objects returned from the contacts.find api. Possibly add a new option to contactFindOptions, something like "maxContacts". For example: maxContacts: Determines how many contact objects the find operation should return. (Integer) (Default: 1000) Here is a code snippet of what I am trying to do: $(’#contacts input:last’).autocomplete({source: function (request, response) { options = new ContactFindOptions(); options.filter = request.term; options.multiple = true; fields = ["displayName", "phoneNumbers", "emails"]; navigator.service.contacts.find(fields, function (contacts) { var responseList = []; console.log(’contacts found for ’ + request.term + ’: ’ + contacts.length); $.each(contacts, function (index, contact) { //console.log(contact); // limit to 10 autocomplete contacts // note: the contacts.find api takes a long time to return when there are // many contacts that match the options.filter if (index > 10) { return false; // break } [Original LightHouse ticket](http://phonegap.lighthouseapp.com/projects/20116/tickets/146) This ticket has 0 attachment(s). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira