如果 field 键,我总是有布尔值。我想要的是如果值 true 显示单元格模板,否则隐藏它。
columnDefs: [{
displayName: 'Advanced',
field: 'advanced',
enableSorting: true,
enableFiltering: true,
enableColumnResizing: false,
cellTemplate: 'scripts/components/profiles/tm/programs/datagrid/advancedCellTemplate.html',
maxWidth: 108,
filter: {
type: uiGridConstants.filter.SELECT,
selectOptions: controller.programsPackage
}
}]
答案 0 :(得分:1)
您可以像这样使用angular.extend或Object.assign
const fields = [angular.extend({}, {
displayName: 'Advanced',
field: 'advanced',
enableSorting: true,
enableFiltering: true,
enableColumnResizing: false,
maxWidth: 108,
filter: {
type: uiGridConstants.filter.SELECT,
selectOptions: controller.programsPackage
}
}, field ? {
cellTemplate: 'scripts/components/profiles/tm/programs/datagrid/advancedCellTemplate.html'
} : null)]
答案 1 :(得分:0)
我发现解决方案非常简单,我只需要根据字段高级值
将条件添加到单元格模板中 The problem I am having is that I dont know how to setup the A_ub or A_eq
In linprog so that B_ub = y1*fmin for d1x1 for example.