gpt4 book ai didi

angular - ng2-smart-table 中的复选框

转载 作者:行者123 更新时间:2023-12-05 04:05:09 25 4
gpt4 key购买 nike

我在我的项目中使用 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',
},
]

试试这个例子 Checkbox, Select and Completer filter types

关于angular - ng2-smart-table 中的复选框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51497047/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com