[
https://issues.apache.org/jira/browse/CB-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14554105#comment-14554105
]
Renan LE CARO commented on CB-58:
---------------------------------
I ran into the same problem (search is too slow for autocomplete) and would
like not to be forced to load 3000+ contacts in a single array in ram on app
startup.
> 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 Cordova
> Issue Type: New Feature
> Components: iOS
> Reporter: Shazron Abdullah
> Priority: Minor
>
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]