I need to display the text in a cell as a link based on a status or as a plain text. If the status is 'Deleted' the name should be displayed as plain text or else as an hyperlink. Below are my grid options. I am always getting it as hyperlink. Someone please help me correct my cell template so that I am getting it correct.
$scope.gridOptions = {
data: 'ProjectDetails',
columnDefs: [
{ field: 'Id', displayName: 'ID', visible: false },
{ displayName: 'Name', width: 200, cellTemplate: '<div> {{row.entity.ProjectStatus}} != Deleted </div>' ? '<div><a href="http://################ID={{row.entity.Id}}">{{row.entity.Name}}</a></div>' : '<div> {{row.entity.Status}}</div>' },
{ field: 'Expense', displayName: 'Operating Expense', width: 185, cellFilter: 'noFractionCurrency' },
{ field: 'Status', displayName: 'Status', width: 150 }
]
};
ng-if helped me.
cellTemplate: "<a target='_blank' ng-if=\"row.entity.Status != 'Deleted'\"
href='#########?ID={{row.entity.Id}}'>{{row.entity.Name}}</a><div ng-
if=\"row.entity.Status == 'Deleted'\">{{row.entity.Name}}</div>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With