问题
Here's the fiddle, the type is radio
but acts like check-box
{type: 'radio', name: 'letter', label: 'Letter'},
{type: 'radio', name: 'custom', label: 'Custom'},
I tried using them under one name that didn't work out, and my 2nd question: how to make one of them as default(as selected).
Keep Smiling :)
回答1:
It seems like the tinymce/ui/Radio
class is not implemented yet. It act like a tinymce/ui/Checkbox
.
You can use the tinymce/ui/ListBox
class as a workaround.
回答2:
for the 2nd question: {type: 'radio', name: 'a', label: 'Letter', checked:'checked'}
回答3:
Radio - not implemented yet
See message here: https://github.com/tinymce/tinymce/blob/ca0f454b9001b9f20aa26349b25f6d839c1a1146/js/tinymce/skins/lightgray/Radio.less
and almost empty class Radio.js
https://github.com/tinymce/tinymce/blob/0ab3af181284a060683b566d50e81381cc6445a9/js/tinymce/classes/ui/Radio.js
来源:https://stackoverflow.com/questions/19607598/radio-buttons-acts-as-check-box-in-tinymce-4