Each row editable using ui-grid AngularJS

607 Views Asked by At

I need to make row editable instead of each field/column. I am also following the tutorial for tutorial for row edit feature

Please find the plnkr link also where I am trying to make row editable instead of each column. I have the button on each row but it doesn't have any functioning.

plnkr link

  $scope.gridOptions.columnDefs = [
    { name: 'id'},
    { name: 'age'  },
    {name: " Edit" , cellTemplate:'<button class=\"btn btn-xs btn-primary\" ng-click=\"grid.appScope.openModal(grid, row)\"> <i class="fa fa-edit" ></i></button>' }];
1

There are 1 best solutions below

0
T.Aguiar On

You can use the 'cellEditableCondition' option on each field and then put one variable to change the status of the fields.

  $scope.gridOptions.columnDefs = [
{ name: 'id'},
{ name: 'age', edicellEditableCondition : variable (true or false) }...]

And then you can change all rows only with one. Hope it helps.