How I fixed ERROR TypeError: Cannot read properties of undefined (reading 'contains') in EJ2 TreeGrid


ej2 syncfusion angular

I had the following event handler for contextMenuClick in the ej2 treegrid:

Ej2 incorrect code

And I got the error on the line 113:

The cannot-read-properties-error-of-undefined in ej2 treegrid

This error was because I passed the wrong object to the getRowInfo method. You need to pass the instance of HTMLTableRowElement. The right example:

Passing HTMLTableRowElement to the getRowInfo

comments powered by Disqus