Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use RichTextEditorWithMetadata in a custom control #127

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

marianfoo
Copy link
Contributor

@marianfoo marianfoo commented Sep 27, 2024

wasnt easy but the control was created only with code, you can define the properties of the RichTextEditorWithMetadata in the creation of the control:
https://ui5.sap.com/#/api/sap.fe.macros.RichTextEditorWithMetadata

const oRichTextEditor = new RichTextEditor({
contextPath: contextPathRichText,
metaPath: metaPathRichText,
buttonGroups: [
// Configuration for various button groups in the editor
// https://ui5.sap.com/#/api/sap.fe.macros.richtexteditor.ButtonGroup
{ name: "font-style", visible: true, priority: 10, buttons: "bold,italic,underline,strikethrough" },
{ name: "styleselect", visible: true, priority: 10, customToolbarPriority: 10, buttons: "styleselect" },
{ name: "font", visible: true, priority: 10, customToolbarPriority: 10, buttons: "fontfamily,fontsize,forecolor,backcolor" },
{ name: "clipboard", visible: true, priority: 10, customToolbarPriority: 10, buttons: "cut,copy,paste" },
{ name: "structure", visible: true, priority: 10, customToolbarPriority: 10, buttons: "bullist,numlist,outdent,indent" },
{ name: "insert", visible: true, priority: 10, customToolbarPriority: 10, buttons: "image,emoticons" },
{ name: "link", visible: true, priority: 10, customToolbarPriority: 10, buttons: "link,unlink" },
{ name: "table", visible: true, priority: 10, customToolbarPriority: 10, buttons: "table" },
{ name: "text-align", visible: true, priority: 10, customToolbarPriority: 10, buttons: "alignleft,aligncenter,alignright,alignjustify" }
]
});

It is possible to use resourceRoots to manifest or launchpad html:

"resourceRoots": {
"custom.control": "../../controlRichTextEditor"
},

data-sap-ui-resourceroots='{
"custom.control": "./controlRichTextEditor"
}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants