BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hello
There is no item in the "Rich Text Editor" to adjust the line spacing. Can this item be added?
<ejs-richtexteditor id="default" created="created">
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
…..
</ejs-richtexteditor>
<script type="text/javascript">
var rteObj, selection, ranges, dialogObj, editorManager;
function created() {
rteObj = this;
editorManager = rteObj.formatter.editorManager;
var btnObj = new ej.splitbuttons.DropDownButton({ items: items, iconCss: 'e-icons e-btn-icons e-line-height', select: select });
btnObj.appendTo('#lineheight_tbar'); // Created drop down button
}
function select(args) { // Triggered when you select the dropdown buttons
if (rteObj.formatter.getUndoRedoStack().length === 0) {
rteObj.formatter.saveData();
}
let nodes = editorManager.domNode.blockNodes();
for (let i = 0; nodes.length > i; i++) {
(nodes[i]).style.lineHeight = args.item.text; // Set the line height
}
rteObj.formatter.saveData();
rteObj.formatter.enableUndo(rteObj);
}
</script>
<style>
.e-dropdown-btn .e-btn-icon.e-icons.e-btn-icons.e-line-height::before {
content: "\eb37";
}
</style> |
public IActionResult Index()
{
var tools = new
{
tooltipText = "Line Height",
template = "<button class='e-tbar-btn e-btn' tabindex='-1' id='lineheight_tbar' style='width:100%'></button>"
};
ViewBag.items = new object[] { tools, "Bold", "Italic", "Underline", "|", "Formats", "Alignments", "OrderedList",
"UnorderedList", "|", "CreateLink", "Image", "CreateTable", "|", "SourceCode", "|", "Undo", "Redo"
};
return View();
} |
thank you
The example you attached works well, but it does not work when I enter the same code into my project.
Could the used version cause problems in working?
public IActionResult Index()
{
var tools = new
{
tooltipText = "Line Height",
template = "<button class='e-tbar-btn e-btn' tabindex='-1' id='lineheight_tbar' style='width:100%'></button>" // Create custom template button
};
ViewBag.items = new object[] { tools, "Bold", "Italic", "Underline", "|", "Formats", "Alignments", "OrderedList",
"UnorderedList", "|", "CreateLink", "Image", "CreateTable", "|", "SourceCode", "|", "Undo", "Redo"
}; // You can define the custom button into Toolbar items.
return View();
} |
<e-richtexteditor-toolbarsettings items="@ViewBag.items"></e-richtexteditor-toolbarsettings>
…..
function created() {
var btnObj = new ej.splitbuttons.DropDownButton({ items: items, iconCss: 'e-icons e-btn-icons e-line-height' });
btnObj.appendTo('#lineheight_tbar');
} |
Excellent
The problem was solved and it worked.
Thank you very much
The problem now is that
When I select several lines to change the distance between the lines, but the distance between all the lines changes
I want to change only the selected lines, not all lines of text
ok
Thank you