Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147557 | Sep 16,2019 12:21 PM UTC | Nov 14,2019 11:45 AM UTC | Blazor | 9 |
![]() |
Tags: Rich Text Editor |
public object[] Tools = new object[] {
"Bold", "Italic", "Underline", "|", new ToolsCollection
{ TooltipText = "Add quick text", Template = "<button @onclick="@
onInsertQuickText" class='e-tbar-btn e-btn icon-quicktext' tabindex='-1' id='custom_tbar' style='width:100%'><div class='e-tbar-btn-text' style='font-weight: 500;'>Quick text</div></button>" }
, "SourceCode", "FullScreen"
};
public class ToolsCollection
{
public string TooltipText { get; set; }
public string Template { get; set; }
}
private void onInsertQuickText()
{
this.RteObj.ExecuteCommand(CommandName.InsertText, "This is a predefined quick text element");
}
Any help would highlly appercipiated. Thank you very much
public object[] Tools = new object[] {
"Bold", "Italic", "Underline", "|",
new ToolsCollection {
tooltipText = "Add quick text",
template = "<button @onclick='@onInsertQuickText' class='e-tbar-btn e-btn icon-quicktext' tabindex='-1' id='custom_tbar' style='width:100%'><div class='e-tbar-btn-text' style='font-weight: 500;'>Quick text</div></button>"
}, "SourceCode", "FullScreen"
};
public class ToolsCollection
{
public string tooltipText { get; set; }
public string template { get; set; }
}
|
<EjsRichTextEditor @ref="@RteObj">
<RichTextEditorEvents OnToolbarClick="@ToolbarClick"></RichTextEditorEvents>
</EjsRichTextEditor>
private void ToolbarClick(RichTextEditorToolbarClickEvent args)
{
if(args.Item.TooltipText)
{
this.RteObj.ExecuteCommand(CommandName.InsertText, "This is a predefined quick text element");
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.