[DevExpress Support Team: CLONED FROM T913730: Rich Text Editor - How to use in an MVC application and use only one External Ribbon button]
I tried to implement an example with your code, but I have too problems:
…
I am trying to use an external ribbon or custom buttons but I don't know how raise font commands. In server component I used ribbon.commands.changeFontBold.execute(false). If the custom ribbon was faster I could use it, but I needed anyway because I want the paste content is normalized and use only a font name and size. In old component I used:
4. richTextControl.KeyUp.AddHandler((s, e) => {
if (e.htmlEvent.code = "KeyV" && e.htmlEvent.ctrlKey) {
ChangeFontStyle(s);
}
updateToolbar();
});
function ChangeFontStyle(s) {
if (debug) console.log('Normalizando el documento para usar la fuente Arial');
//e.preventDefault && e.preventDefault();
//e.stopPropagation && e.stopPropagation();
var savedPosition = s.selection.intervals;
s.selection.selectAll();
s.commands.changeFontName.execute("Arial");
s.commands.changeFontSize.execute(11);
s.selection.intervals = savedPosition;
}
function updateToolbar() {
if (activeEditor != undefined) {
for (var key in commandsTable) {
if (!commandsTable.hasOwnProperty(key)) continue;
updateToolbarItem(key, commandsTable[key].call(this, activeEditor));
}
}
}
function updateToolbarItem(itemName, command) {
var item = ExternalRibbon.GetItemByName(itemName);
if (activeEditor != undefined) {
var state = command.getState();
item.SetEnabled(state.enabled);
ExternalRibbon.SetItemValueByName(itemName, state.value)
}
}