I have a ng-grid table and one of the column Defs has a cell template to show icon. Currently icon shows up across all rows.
Can anyone help me how to display icon f
Try this sample out...use ng-show for hiding and showing
Working Demo
var myapp = angular.module('myapp', [ 'ngGrid' ]);
myapp.controller('MyCtrl', function($scope)
{
$scope.editableInPopup = ' '
$scope.edit = function edit(row)
{
console.log("Here I need to know which button was selected " + row.entity.name)
}
$scope.myData = [ {
name : "Moroni",
age : 50
}, {
name : "Tiancum",
age : 43
}, {
name : "Jacob",
age : 27
}, {
name : "Nephi",
age : 29
}, {
name : "Enos",
age : 34
} ];
$scope.gridOptions = {
data : 'myData',
columnDefs : [ {
field : 'name',
displayName : 'Name'
}, {
field : 'age',
displayName : 'Age',
editableCellTemplate : self.editableCellTempate,
enableCellEdit : true
}, {
displayName : 'Popup',
cellTemplate : $scope.editableInPopup
} ]
};
});