0
以下示例是向tinyMCE添加自定义下拉列表,是否可以在init tinyMCE后再次更改?例如,在初始化tinyMCE之后,再次用另一个按钮以不同的列表更新列表。 https://codepen.io/tinymce/pen/JYwJVr是否可以在tinymce初始化后更改tinyMCE自定义工具栏列表框值
tinymce.init({
selector: 'textarea',
height: 500,
toolbar: 'mybutton',
menubar: false,
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tinymce.com/css/codepen.min.css'],
setup: function (editor) {
editor.addButton('mybutton', {
type: 'listbox',
text: 'My listbox',
icon: false,
onselect: function (e) {
editor.insertContent(this.value());
},
values: [
{ text: 'Menu item 1', value: ' <strong>Some bold text!</strong>' },
{ text: 'Menu item 2', value: ' <em>Some italic text!</em>' },
{ text: 'Menu item 3', value: ' Some plain text ...' }
],
onPostRender: function() {
// Select the second item by default
this.value(' <em>Some italic text!</em>');
}
});
}
});