Want to make cell of 1 row of angular ui grid columndef editable

318 Views Asked by At

how to change columndef settings dynamically loaded , like one row must be editable and other should not be editable when loaded,but mine whenever celleditable true for one row it makes all other rows cells also editable

1

There are 1 best solutions below

0
On

I can't understand if you meant 1 row or row 1. But customizing the celltemplates of columns based on rowRenderIndex might help.

var gridOptions = {
        enableFiltering: true,
        rowTemplate: rowTemplate(),
        data: [{one : 1, two : 2, three: 3, four : 4, five:5 }],
        columnDefs: [
          { field: 'one' },
          { field: 'two' },
          { field: 'three' },
          { field: 'four' },
          { field: 'five', cellTemplate: '<div class="ui-grid-cell-contents">
          <input ng-if="!rowRenderIndex" type=number />
          <span ng-if="rowRenderIndex">{{row.entity.five}}</span>
          </div>'}
        ]
      };