I'm attempting to render a number field as a picklist.
Here's what I've got so far:
var field = arguments[0], value = arguments[1], $ = skuid.$;
field.metadata.picklistEntries = [
{ value: 30, label: '30 minutes', defaultValue: false, active: true },
{ value: 60, label: '60 minutes', defaultValue: true, active: true }
];
field.metadata.defaultValue = 60;
skuid.ui.fieldRenderers.PICKLIST[field.mode](field,value);
}
It's working, sort of.
With the defaultValue line I was trying to eliminate the "none" option, but I'm still getting "--None--" by default.
Is there a way to eliminate the --None-- option?
The values are returned as strings. Not sure if there's a way to change that so that it outputs numbers. If there's not, I can handle it on the other side with Number().
Thanks!
Here's what I've got so far:
var field = arguments[0], value = arguments[1], $ = skuid.$;
field.metadata.picklistEntries = [
{ value: 30, label: '30 minutes', defaultValue: false, active: true },
{ value: 60, label: '60 minutes', defaultValue: true, active: true }
];
field.metadata.defaultValue = 60;
skuid.ui.fieldRenderers.PICKLIST[field.mode](field,value);
}
It's working, sort of.
With the defaultValue line I was trying to eliminate the "none" option, but I'm still getting "--None--" by default.
Is there a way to eliminate the --None-- option?
The values are returned as strings. Not sure if there's a way to change that so that it outputs numbers. If there's not, I can handle it on the other side with Number().
Thanks!