Is it possible to change tinyMCE custom Toolbar ListBox values after tinymce init -


following example add custom dropdown tinymce, possible change again after init tinymce? example, after init tinymce, update list again button different list. https://codepen.io/tinymce/pen/jywjvr

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: '&nbsp;<strong>some bold text!</strong>' },         { text: 'menu item 2', value: '&nbsp;<em>some italic text!</em>' },         { text: 'menu item 3', value: '&nbsp;some plain text ...' }       ],       onpostrender: function () {         // select second item default         this.value('&nbsp;<em>some italic text!</em>');       }     });   } }); 

i didn't find choice can update custom dropdown. not way way can make work. did remove tinymce , re-add again.

tinymce.remove(); tinymce.init({  selector: 'textarea',      setup: function (editor) {                var self = this;                 editor.addbutton('mybutton', {                   type: 'listbox',                   text: 'mylist',                   icon: false,                    onselect: function (e) {                          editor.insertcontent(this.value());                   },                   values: newlist,                   onpostrender: function () {                     // select second item default                     this.value('&nbsp;<em>some italic text!</em>');                   }                 });             } }); 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -