Type: array
When the array contains phone
, display the contact phones column. By default, it will always display name
and email
columns.
Here is an example showing it used with the filter option to only show the contacts that contain phones
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<!-- | |
Include the script anywhere on your page, usually in the head | |
(don't forget to replace YOUR_WIDGET_SCRIPT with your CloudSponge key) | |
--> | |
<script src="//api.cloudsponge.com/widget/localhost-only.js"></script> | |
<script> | |
cloudsponge.init({ | |
// set the phone column to be display | |
displayContactsColumns: ["email", "phone"], | |
// Set the filter to only show contacts with phone numbers | |
filter: function(contact){ | |
return contact.phone.length > 0 || contact.email.length > 0; | |
} | |
}); | |
</script> | |
<textarea class="cloudsponge-contacts"></textarea> | |
</body> | |
</html> |