Last active
July 26, 2017 18:02
-
-
Save aribeiro/197dab5150d8577594aeb9bf360b1c05 to your computer and use it in GitHub Desktop.
CloudSponge Widget Reference - Display Phone Column and filter contacts with phone number
This file contains hidden or 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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment