【发布时间】:2016-09-16 19:32:19
【问题描述】:
只要字段值不是空字符串,我就需要在我的 ui-grid 中显示一个按钮。我尝试使用ng-if,但它不起作用。这是我的网格选项中的代码:
{ field: 'ReleaseStatus',
width: 125,
displayName: 'Release Status',
cellTemplate:
'<div ng-if="row.entity.ReleaseStatus != """>
<button id="editBtn"
type="button"
class="btn btn-default"
data-toggle="modal"
data-target="#myModal"
ng-click="grid.appScope.launch(row)">
{{COL_FIELD}}
</button>
</div>'
},
没有ng-if,按钮显示效果很好。但是,由于某些记录的 ReleaseStatus 字段为空字符串,因此不应出现该按钮。
非常感谢任何帮助。
【问题讨论】:
标签: javascript angularjs angular-ui-grid