I am trying to enable/disable a button based on the selection of a row on a ui-grid. If there are no rows selected, the button is disabled.
I found this plunkr with the
you can first get all the records selected in the grid
currently by doing :
$scope.rowsSelected = $scope.gridApi.selection.getSelectedRows();
now we can get the length of this array using :
$scope.countRows = $scope.rowsSelected.length;
based on $scope.countRows>0
or 0
you can enable or disable a button using
ng-disabled = "countRows"