Error on goTo()

I receive this error when attempting to call ss.goTo("D6") when the cell exists on the current sheet.

ej2.min.js:10 Uncaught TypeError: Cannot read properties of undefined (reading 'style')
    at qT (ej2.min.js:10:659670)
    at e.updateActiveCell (ej2.min.js:10:19673747)
    at e.selectRangeByIdx (ej2.min.js:10:19672432)
    at ej2.min.js:10:19657120
    at Array.forEach (<anonymous>)
    at e.selectMultiRange (ej2.min.js:10:19657096)
    at e.selectRange (ej2.min.js:10:19656612)
    at e.notify (ej2.min.js:10:743430)
    at t.notify (ej2.min.js:10:849088)
    at t.selectRange (ej2.min.js:10:20331055)





2 Replies

JO John October 23, 2023 02:45 PM UTC

FYI: Using:

<script src="https://cdn.syncfusion.com/ej2/23.1.36/dist/ej2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>


VR Vasanth Ravi Syncfusion Team November 17, 2023 10:30 AM UTC

Hi John,


Thanks for contacting Syncfusion Support...!


On a button click event we have called the goTo method and the cell selection has been navigating to the provided address as expected and no issue has been found as mentioned. Attached sample for reference.


CODE BLOCK:


<button class="e-btn" id="apply-button"> GoTo Cell </button>

 

document.getElementById("apply-button").onclick = () => {

    // To navigate to a cell address within a workbook.

    spreadsheet.goTo('C1');

    // You can navigate to a specific cell address by specifying the sheet name as well as the cell address.

    // spreadsheet.goTo('Sheet2!B1');

};

 



Stackblitz Sample: https://stackblitz.com/edit/8klg9d-blmg9j?file=index.ts


API Link: https://helpej2.syncfusion.com/documentation/api/spreadsheet/#goto


Please check the above sample and share the below requested details to proceed further.


  1. Exactly at what scenario you have been facing the issue. Share those details.
  2. Whether you have been trying to use the goTo method on initial rendering or performing any actions in spreadsheet.
  3. Share the video demonstration of the issue for better clarification.
  4. If possible, share the spreadsheet rendering snippets for further validation (or) replicate the issue on the above attached sample and share it back to us.


Note: We suggest you use the latest version to avail the latest fixes and features of our spreadsheet component.


Get back to us for further clarifications.


Loader.
Up arrow icon