Skip to content

Instantly share code, notes, and snippets.

@travist
Created August 22, 2019 03:57
Show Gist options
  • Save travist/9e61e53a045c31eb88111c1d9ecc6356 to your computer and use it in GitHub Desktop.
Save travist/9e61e53a045c31eb88111c1d9ecc6356 to your computer and use it in GitHub Desktop.
Select - Custom Default Value
instance.component.onSetItems = function(component, items) {
var employees = [];
for (var id in component.data) {
if (
component.data[id] &&
(id === 'employee1' ||
id === 'employee2' ||
id === 'employee3')
) {
employees.push(component.data[id].data.email);
}
}
return items.filter(function(item) {
return (employees.indexOf(item.data.email) === -1);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment