Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created May 3, 2013 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsmith/5507579 to your computer and use it in GitHub Desktop.
Save lsmith/5507579 to your computer and use it in GitHub Desktop.
lookup: function (col) {
var className = cName('lookup'),
lookup = col.lookupTable || {},
entries, i, len;
if (isArray(lookup)) {
entries = lookup;
lookup = {};
for (i = 0, len = entries.length; i < len; ++i) {
lookup[entries[i].value] = entries[i].text;
}
}
return function (o) {
o.className = className;
return lookup[o.value];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment