People Picker

In Enyo, a PeoplePicker is a Popup control used to select one or more contacts and return data for the people represented.

To use a People Picker control in an application, add the following line to the app's depends.js file:

"$enyo-lib/contactsui/"

In your application code, declare a PeoplePicker as follows:

{name: "preferredName",
  kind: "PeoplePicker",
  onContactClick: "contactClickHandlerFunctionName",
  onCancelClick: "cancelClickHandlerFunctionName"}

Open the PeoplePicker by calling its pickPerson method, which takes no arguments.

Published Properties

Name Default Description
cropWidth undefined (Optional) int to set the width of the crop window
cropHeight undefined (Optional) int to set the height of the crop window
exclusions [] (Optional) array of ids of persons to exclude
mode "noFilter" (Optional) mode. Possible values are "noFilter" (all), "favoritesOnly", and "noFavoritesOnly".
showSearchBar true (Optional) boolean. If true, the search bar is shown.
showIMStatuses false (Optional) boolean. If true, IM statuses are shown.
showFavStars true (Optional) boolean. If true, a star is shown next to favorited persons.
enableGAL false (Optional) boolean. If true, GAL search is enabled.

Published Events

You may specify handlers for any or all of the events listed below. Data is returned in the form:

{event: "<eventName>" , value: "<value>"}

Note that the value field will be equal to "" for all events other than onContactClick. In the case of onContactClick, the value will be a raw JSON person object from the db.

onContactClick

Fires when a person is clicked. Person data is sent with this event.

onCancelClick

Fires when the Cancel button is clicked. The dialog closes and dispatches this event.

onListUpdated

Fires when the persons db is updated; the visible area of the list may or may not change.

onSearchCriteriaUpdated

Fires when the Search field is updated (but not cleared).

onSearchCriteriaCleared

Fires when the Search field is cleared.