Functions to move the cursor to next row or next cell

Hi!

I'm sorry if this isn't the correct place, but I just wanted to make a suggestion to the functions to move the cursor to the next cell or roll presented at https://ej2.syncfusion.com/documentation/document-editor/how-to/insert-text-or-image-in-table-programmatically. There it uses substring to select the right number in select API's hierarchal index to change, but I found safer to split the string into arrays. I say this because the table index for example can have two digits, like '0;10;0;0;1;0'. 

Code:

function moveCursorToNextCell() {
    // To get current selection start offset
    let startOffset = documenteditorContainer.documentEditor.selection.startOffset;
    // Increasing cell index to consider next cell
    let startOffsetArray = startOffset.split(';');
    startOffsetArray[3] = parseInt(startOffsetArray[3]) + 1;    
    // Changing start offset
    startOffset = startOffsetArray.join(';');
    // Navigating selection using select method
    documenteditorContainer.documentEditor.selection.select(startOffset, startOffset);
}

function moveCursorToNextRow() {
    // To get current selection start offset
    let startOffset = documenteditorContainer.documentEditor.selection.startOffset;
    // Increasing row index to consider next row
    let startOffsetArray = startOffset.split(';');
    startOffsetArray[2] = parseInt(startOffsetArray[2]) + 1;
    // Going back to first cell
    startOffsetArray[3] = 0;
    // Changing start offset
    startOffset = startOffsetArray.join(';');
    // Navigating selection using select method
    documenteditorContainer.documentEditor.selection.select(startOffset, startOffset);
}

2 Replies

KM Kavitha Muralitharan Syncfusion Team July 18, 2023 01:42 PM UTC

Hi Gabriel,


Currently, We are Checking the scenario and will get back to you by July 20, 2023.


Regards,

Kavitha M




KM Kavitha Muralitharan Syncfusion Team August 9, 2023 06:24 AM UTC

Thank you for sharing your suggestion with us, Gabriel.

We have considered it and will add it to our user guide documentation in one of our upcoming releases.


Loader.
Up arrow icon