Greetings all,
I’ve been trying to get a custom renderer snippet for a picklist working, but I just haven’t been able to find anything here on the community that would help. The picklist that I’m trying to render is a custom field that is not dependent on any other picklists, or record types. The problem that I’m having is that even though my console log shows that the picklist values are being set to what I want, the normal picklist values are still being rendered. Here is the snippet:
var field = argumentsr0], value = skuid.utils.decodeHTML(argumentsr1]), $ = skuid.$; var otherEntry; var picklistEntriesNew = e]; field.metadata.picklistEntries.forEach(function(entry) { if(entry.value === 'Bad Data') entry.label = 'Bad Data (Delete)'; if(entry.value === 'Other') otherEntry = entry; if((entry.value != 'Intake Queue Errors') && (entry.value != 'Other')){ picklistEntriesNew.push(entry); } }); // Users want the picklist entries to be in alphabetical order, so we sort them picklistEntriesNew.sort(function(entryOne, entryTwo){ var entryValueOne = entryOne.value.toLowerCase(); var entryValueTwo = entryTwo.value.toLowerCase(); return ((entryValueOne < entryValueTwo) ? -1 : ((entryValueOne > entryValueTwo) ? 1 : 0)); }); picklistEntriesNew.push(otherEntry); field.metadata.picklistEntries = picklistEntriesNew; skuid.ui.fieldRenderersefield.metadata.displaytype]lfield.mode](field,value);
We have another snippet similar to this one (that one just removes one of the picklist values before rendering) that works as expected. And the field for the above snippet is set up the same way as the snippet that we know that works.
Any clue as to what the problem could be?
Many thanks in advance!