ng2智能表:如何在编辑模式下预先选择具有当前值的下拉列表



我有一列在编辑时需要是dropDown。

当我按下编辑时,我得到了完整的下拉列表,但没有选择值

这是我的代码:

CompanyName: {
title: 'CompanyName,
type: 'html',
valuePrepareFunction: (cell, row) => {
return row.CompanyName
},
editor: {
type: 'list',
config: {
list: this.companies  // this.companies = [{value: 1, title: "TestCompany"]
}
}
},

你能试试吗

valuePrepareFunction: (cell, row) => {
return row.title
},

参考-https://github.com/akveo/ng2-smart-table/issues/665

最新更新