相关疑难解决方法(0)

ui-grid angularjs中的条件单元模板

如何在ui-gridcellTemplate中显示数据时添加条件:

$scope.status = ['Active', 'Non Active', 'Deleted'];
$scope.gridOptions = {
    columnDefs: [{
        field: 'code'
    }, {
        field: 'name'
    }, {
        field: 'status',
        cellTemplate: '<div>{{status[row.entity.status]}}</div>'
    }]
};
Run Code Online (Sandbox Code Playgroud)

预期结果应为行状态显示Active/NonActive/Deleted.

这是掠夺者

提前致谢.

angularjs angular-ui-grid

15
推荐指数
4
解决办法
8万
查看次数

标签 统计

angular-ui-grid ×1

angularjs ×1