I’m trying to render a non-required Field Editor picklist field as radio buttons without the “none” option. I know this essentially makes it required, but in this case we want to allow people to not choose a value without cluttering the UI with “none.” We are okay with them not being able to unselect once they select. I’ve been working on a custom field renderer:
var field = arguments 0],value = arguments 1];<br>if (field.mode == 'edit') {<br> var picklistEntries = new Object();<br> picklistEntries.value = "A";<br> picklistEntries.label = "A";<br>}<br>field.element.append(skuid.ui.renderers.PICKLIST.edit({<br> entries : picklistEntries,<br> renderas : "RADIO_BUTTONS",<br> onChange : function(value) {<br> field.model.updateRow(field.row,field.id,value,{ initiatorId : field._GUID});<br> },<br> mode : field.mode,<br> noneLabel : "ignore"<br> }));
This only shows the “none” option. Alternatively, I’ve been able to push new values to the end of the existing values, but that doesn’t help. My goal was to be able to replace the list, including “none.”
Any ideas?
My next attempt was going to be to actually output the HTML for each radio button and add CSS to the “none” option so that I could hide it. Any code samples for doing something like that?
Thanks,
Seth