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");
}
}
|