user1030181
user1030181

Reputation: 2015

How to display No Value as text if Column value is DB Null in UI GRID

How to show NO VALUE if column value is DB Null in angularjs ui grid. I tried using the code as below but it does not work. Am i missing anything.

cellTemplate: '<div class="ui-grid-cell-contents" ng-if="row.entity.VariancePercentage>{{row.entity.VariancePercentage | number:2}}</div><div class="ui-grid-cell-contents" ng-if="!row.entity.VariancePercentage">No Value</div>'

Upvotes: 0

Views: 1056

Answers (1)

Remko
Remko

Reputation: 359

(moved from comment)

I think your brackets/quotes are a bit unbalanced. Maybe this does the trick:

cellTemplate: '<div class="ui-grid-cell-contents"><span ng-if="row.entity.VariancePercentage">{{row.entity.VariancePercentage | number:2}}</span><span ng-if="!row.entity.VariancePercentage">No Value</span></div>'

Upvotes: 1

Related Questions