How to get the cell value from ng-grid

前端 未结 3 2049
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 03:06

I am a beginner of AngularJS. I study the demo of ng-grid and have a question.

index.html






        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-06 03:38

    You can access the rowItem of the selected row with the arguments to the afterSelectionChange event. The entity property will have the id and name properties.

     $scope.gridOptions = { 
        data: 'myData',
        selectedItems: $scope.mySelections,
        multiSelect: true,
        afterSelectionChange: function (theRow, evt) {      
           alert(theRow.entity.id);
    }
    

    };

提交回复
热议问题