Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX 23.1: TinyMCE Custom Buttons

Marvin MurmannJun 5 2023 — edited Jun 5 2023

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?

Comments
Post Details
Added on Jun 5 2023
6 comments
1,822 views