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 code:
var ctpl = '';
$scope.gridOptions = {
data: 'myData',
enableRowSelection:false,
columnDefs: [{
field: 'name',
displayName: 'Name'
}, {
field: 'age',
displayName: 'Age',
}, {
displayName: 'Action',
cellTemplate: ctpl
}]
};
$scope.addItem=function(){
$scope.myData.push({name:'new',age:''});
}
See it working here