javascript – Autodesk forge viewer table row click to isolate elements

I am trying to create a dynamic table inside the viewer’s page.
each row of the table represents an object from the model and has a couple of different parameters ( name, level, etc..)
I want to make a click event on each row, that isolates the element in the viewer’s model.

I have created the table programmatically using js. (the table is created after pressing an external command button )

how can I add an event listener to a row click, that would isolate the element?

this is my code for creating the table after pressing the command button:

”’` var myTable = $(‘.my-table’);
var myArr=rows; //matrix of object values

                        for(var i=0; i<myArr.length;i++)
                        myTable.append("<tr id="+i+">"
                                            +" <td>"+myArr[i][0]+"</td>"
                                            +"<td id="+"tt"+">"+myArr[i][7]+"</td>"                     
                                const row = document.getElementById(`${i}`);
                                row.addEventListener('onClick', function (evt, item) {/// we are using a viewer api property to  isolate the 

Read more here: Source link