【问题标题】:ng2-smart-table: How to preselect dropdown with the current value in edit modeng2-smart-table:如何在编辑模式下使用当前值预选下拉列表
【发布时间】:2020-05-19 18:26:58
【问题描述】:

我有一列需要在编辑时成为下拉列表。

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

这是我的代码:

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

【问题讨论】:

  • 如果有不清楚的地方请询问,我会提供更多信息

标签: angular ng2-smart-table


【解决方案1】:

你可以试试-

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-12
    • 1970-01-01
    • 2017-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多