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:
JavaScript
x
4
1
api.forEachNode(function(node){
2
api.refreshRows([node]);
3
})
4
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()
?
Advertisement
Answer
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.
JavaScript
1
3
1
var model = api.getModel();
2
console.log(model.getVirtualRow(idx));
3