Skip to content

How to get a node by index in ag-grid?

AgGrid expects node(s) to be passed in to lot of it’s data functions. How do you get a node by index? Look at the snip below:


I can pass the node parameter to refreshRows() function since I’m getting it through forEachNode().

How do you get a node by index without iterating through forEachNode() ?


You can use getVirtualRow() method to get a single row. This function is a part of the Row Model. You can get the Row Model by getModel() function.

var model = api.getModel();