ag-Grid offers a multitude of methods that can use to extract and manipulate your data, which are covered in our documentation under Grid API. In this post, we’ll show you how to retrieve all currently selected data in ag-Grid.

Firstly, row selection must be enabled by setting gridOptions.rowSelection to either “single” or “mulitple”, depending on the selection behavior you’d like to implement.

You can then use the grid API method getSelectedNodes() to return a list of all currently selected rows in ag-Grid. Extracting the data from each node is as simple as mapping over each node and returning its data property.

Here is the code when using a JavaScript framework:

#ag-grid #angular #javascript #react #web-development #vuejs

How to Get the Data of Selected Rows in ag-Grid
14.55 GEEK