Hello,
in anticipation of the introduction of TinyMCE I played around with it beforehand and built some custom functionality with the help of their Custom Buttons
Now, APEX gives the option to customize the initialization-function, however modifying the “setup” attribute (where custom buttons get created) does not seem to be a viable way of recreating this.
For reference, this is what the help-section says how to use that field:
function(options){
// disable the Text Patterns feature
options.editorOptions.text_patterns = false;
// apply a custom toolbar
options.editorOptions.toolbar = "bold italic | bullist numlist | undo redo";
return options;
}
which looks like modifying attributes post-initialization to me, which obviously does not work for a setup-function call.
This is what I tried:
function(options){
options.editorOptions.toolbar = "undo redo || myButton || bold italic";
options.editorOptions.setup = "(editor) => { editor.ui.registry.addButton('myButton', { text: 'My Custom Button', onAction: () => alert('Button clicked!') });";
return options;
}
Does anyone have an idea on how to solve this?