Hi,
I am using Document editor for my Angular Application.
| Image | Image |
| Text | Text |
table, Image and text needs to be inserted Programmatically from .ts file
Regards,
Parth
|
StartOffset:
EndOffset:
select
| |||
|
|
Welcome |
|
Hi Suriya,
Thanks for your solution.
It help me to achieve some part of the requirement.
What want to achieve is:
|
Image1 |
Image2 |
Image3 |
Image4 |
Image5 |
|
name1 |
name2 |
name3 |
name4 |
name5 |
Like this. If possible please provide me example.
Regards,
Parth
|
Queries
|
Solution | |
|
I want to insert table at the end of the document.
|
Kindly refer the below code snippet to achieve your requirement.
Code snippet:
Kindly refer below API documentation link :
| |
|
How can I set courser to specific place (give example if possible)
|
You can set cursor position to anywhere in the document via select API of selection module.
if block is a paragraph, then the hierarchical index will be like below.
SectionIndex;ParagraphIndex;offset
Sample code snippet
documentEdContainerIns.documentEditor.editor.insertText("Welcome")
documentEdContainerIns.documentEditor.selection.select("0;0;0", "0;0;2")
The above code will select the letters “We” from inserted text “Welcome”
| |
|
I have list of Images and its name as an separate Array. I wanted to insert Image and it's dynamically into table.
|
We will share the sample based on your requirement on July 23,2021. |
Hi Suriya,
I would like to insert this table at the end of the document. for that I have used
before we insert the table in to the editor.
Now with this code it's throwing error :
Just Try to add line which I added and try it .
One more scenario for same error: when you have some text into editor and than you go very end and click at the editor and than try to add table throwing same error.
Also provide solution for that error.
Regards,
Parth
Hi,
Thanks a lot. You solution works.
Some more requirements:
|
Insert line break |
Using insertText API, you can insert line break.
Code snippet:
| |
|
Insert white space |
Using insertText API, you can insert white space.
Code snippet:
| |
|
Insert new line |
We are sorry to say that we don’t have API to insert new line programmatically. | |
|
When the track changes is on and I try to remove the text from the editor it automatically opens track changes pan which I dont want to open at this place. |
We have prepared work-around solution for your requirement. Kindly check the below sample.
In this sample, we are making another button to control the track changes pane open/close as a manual option using showRevisions property. Also, binded this property in selectionChange and contentChange.
|