Hi @raffaelj,
I’ve installed the SelectRequestOptions addon which is really great for my usecase.
I wonder how I could modify it to display the field as a dropdown select (html ) rather than radio buttons?
Thank you!
Hang
Hi @raffaelj,
I’ve installed the SelectRequestOptions addon which is really great for my usecase.
I wonder how I could modify it to display the field as a dropdown select (html ) rather than radio buttons?
Thank you!
Hang
The dropdown select is not implemented yet, but it should be easy to add it here:
Something like:
<cp-field type="select" if="{ opts.display_field == 'select' }" opts="{ {options:values} }" bind="{ opts.bind }"></cp-field>
Not tested, yet.
Thanks @raffaelj !!
It works like a charm.
To support <option>
labels I further added this:
if (opts.display_field) {
if (opts.display_field == "select") {
$this.values = $this.options.map(function(o) {
return { value: o.value, label: o.label };
});
} else {
$this.values = $this.options.map(function(o) {
return o.value;
});
}
}
I’m glad, that it worked. I opened an issue as a reminder to add a dropdown select soon…