Jay
Jay

Reputation: 9509

AngularJS - UIGrid - How to read data for a selected row?

In my Angular apps I am using UI Grid (http://ui-grid.info/docs/#/tutorial)

How do I get the data of the selected row ?

Plunker : http://plnkr.co/edit/GpsfCHewYjhiPcwAQheA?p=preview

HTML:

<div ui-grid="gridOptions" ui-grid-selection class="grid"></div>

Upvotes: 0

Views: 750

Answers (1)

Jay
Jay

Reputation: 452

The grid selection module has a method to get the selected rows: getSelectedRows().

You can access this method through the gridApi if you define your options like so:

$scope.gridOptions = {
  columnDefs: $scope.columns,
  onRegisterApi: function(gridApi) {
    $scope.gridApi = gridApi;
  }
};

Upvotes: 2

Related Questions