Selecting different rows programmatically

I wan to select n different rows on mouse hover on a button which is outside the diagram.
Example : Select 1,3,4,5 rows on mouse hove on the button.

OK, so you can see what the click event handler normally does in order to select or de-select a row/field. What is the problem when you try to do that programmatically? You don’t say what the problem is, you don’t show the relevant code, and you don’t show what the current results are, so it’s hard for anyone to provide useful advice.

On button click i only know the row numbers, and function for selecting row is taking the item object
and i only have the row numbers which i want to highlight rows something like this


First, you’ll need to find the Node that has the fields/rows that you want to select. Do you know how to do that in your context?

Second, once you have a reference to the particular Node, you’ll need to find the Panel that holds the list of element Panels that each implement a row/field. In the Selectable Fields sample, that is a matter of calling node.findObject("TABLE").

Third, once you have the right “Table” Panel, you can call Panel.elt to get the nth element. Then you can call that sample’s setFieldSelected function.

Fourth, you should perform all of this code, which presumably has a loop to select multiple fields/rows, within a transaction that skips the UndoManager. You can see what the sample’s onFieldClick does, or you can just wrap your code with myDiagram.commit(diag => { . . . }, null);