Title: texteditor contextMenu Post by: andyj on February 27, 2023, 01:22:48 PM I want to dispense with the static texteditor toolbar and replace it with a context menu.
I have used the following code to create a context menu. I have three texteditor fields on my page with ids: 'te0' 'te1' and 'te2' The javascript code: Code: $(document).ready(function () { The simplified menu: Code: <div id="teMenu" class="easyui-menu" style="border-top-width: 1px; top: 1px; width: 435px;"> One of the text editor divs: Code: <div id="te0" fit="true" class="easyui-texteditor" title="TextEditor" data-options="header:'none' "/div> My question is: How do I invoke the various commands (bold, italic etc.)? I tried including in the menu: Code: <a href="#" onclick="$('te0').texteditor('getEditor').texteditor('execCommand','bold');" class="easyui-menubutton" Title: Re: texteditor contextMenu Post by: jarry on March 01, 2023, 12:12:58 AM This code works fine.
Code: $('#te0').texteditor('getEditor').texteditor('execCommand','bold') Title: Re: texteditor contextMenu Post by: andyj on March 02, 2023, 08:42:50 AM Thanks Jarry
OOooops, forgot the # Works fine. |