Hi hardik,
We are sorry to say that Document Editor doesn’t have options to add text to cells programmatically. Manually, you have to click the cell and have to add content.
You can select using hierarchal position.
please refer the below link:
You can set cursor position to anywhere in the document via select API of selection module.
Sample code snippet
StartOffset:
var startOffset = containerInstance.documentEditor.selection.startOffset; |
EndOffset:
var endOffset = containerInstance.documentEditor.selection.endOffset |
select
containerInstance.documentEditor.selection.select(startOffset, endOffset) ; | |
|
Note:
hierarchical index will be in below format.
sectionIndex;blockIndex;offset
If the block is a table, then the hierarchical index will be like below.
SectionIndex;TableIndex;RowIndex;CellIndex;BlockIndex;offset
Sample code snippet:
containerInstance.documentEditor.editor.insertTable(2,2);
please refer the below example for your reference:
(e.g):
You want insert text in the 0 row in 1 column:
containerInstance.documentEditor. selection.select("0;0;0;1;0;0", "0;0;0;1;0;0");
containerInstance.documentEditor.editor.insertText(“Welcome”);
For your requirement:
how to insert text in the second row of the second column and third column:
containerInstance.documentEditor. selection.select("0;0;1;1;0;0", "0;0;1;1;0;0");
containerInstance.documentEditor. selection.select("0;0;1;2;0;0", "0;0;1;2;0;0");
Please let us know above will satisfy your requirement.
Regards,
Kurthis Banu A.