我在我的项目中使用 ng2-smart-table,我想添加一个带有复选框的列,在渲染时将根据绑定(bind)表格的对象进行检查。 在对象中,有一个带有 bool 值的字段,它将确定复选框是否被选中,并且在复选框中进行更改后,更改后的值应该可用。
最佳答案
您需要设置过滤器类型复选框
passed: {
title: 'Passed',
filter: {
type: 'checkbox',
config: {
true: 'Yes',
false: 'No',
resetText: 'clear',
},
},
},
在您的数据中您需要传递复选框值
data = [
{
id: 4,
name: 'Patricia Lebsack',
email: 'Julianne.OConner@kory.org',
passed: 'Yes',
},
]
关于angular - ng2-smart-table 中的复选框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51497047/