Skip to content

Instantly share code, notes, and snippets.

@jbest84
Created February 19, 2013 22:49
Show Gist options
  • Save jbest84/4990928 to your computer and use it in GitHub Desktop.
Save jbest84/4990928 to your computer and use it in GitHub Desktop.
Contact/Edit cuisine preferences textRenderer and formatValue function; fixed
formatCuisinePrefs: function(selections) {
if (typeof selections === 'string') {
return selections;
}
var values = [];
for (var key in selections) {
var data = selections[key].data;
if (data && data.text) {
values.push(data.text);
} else if (typeof data === 'string') {
values.push(data);
}
}
return values.join(', ');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment