I am writing a plugin that allows the user to insert an address.
When the user selects an address it should be inserted at the current cursor position.
The address is an array of strings. Each string should be placed on a new line.
How can this be accomplished?
When trying the oParagraph.addText() approach from the helloworld example the text is always inserted flush left.
(https://api.onlyoffice.com/plugin/example)
The symboltable example seems to consider the cursor position but uses an un-documented function called "PasteHtml".
(https://github.com/ONLYOFFICE/sdkjs-plu ... oltable.js)
Regards,
M. Meyer
Plugin: Insert text at cursor position
Re: Plugin: Insert text at cursor position
Hello mmeyer!
Please use oParagraph.addText() but it's not necessary to add whole text via one command.When trying the oParagraph.addText() approach from the helloworld example the text is always inserted flush left.
Yes, it's not documented yet. We will but you can use it - insert content in html format "PasteHtml".The symboltable example seems to consider the cursor position but uses an un-documented function called "PasteHtml".
-
- Posts: 4
- Joined: Tue Sep 18, 2018 10:40 am
Re: Plugin: Insert text at cursor position
I post here another answer for the same topic:
Insert text at cursor position is possible via API with drag & drop event?
Insert text at cursor position is possible via API with drag & drop event?
Re: Plugin: Insert text at cursor position
Hello,
unfortunately, text insertion via drag&drop is not supported.
unfortunately, text insertion via drag&drop is not supported.