【发布时间】:2011-04-27 06:43:24
【问题描述】:
我的任务是使用特定 ID 检索联系人详细信息。
我正在使用以下功能从另一个页面检索 viewId。在这里,联系人列表页面是 index.html,当用户单击查看图标时,它将被重定向到 viewContact.html,我在其中放置了以下代码以检索联系人详细信息。
现在我面临的主要问题是,如果我将使用下面的代码,那么它将在所有字段下方搜索 id。但我只想在 id 字段中搜索。这样我才能得到完美的结果。
//this is viewContact.html
var options = new ContactFindOptions();
options.filter= viewId; // getting from index.html
options.multiple=false;
//options.filter = 23;//testing with static id
var fields = ["id","name", "phoneNumbers", "emails", "photos"];
//这里我不能在字段中只使用id,否则将无法显示联系人列表的全部内容。
请在phonegap中给我解决方案。
navigator.service.contacts.find(fields, onSuccess, onError, options);
【问题讨论】:
标签: web-applications cordova contact