【问题标题】:Textfield not displaying in ng2-smart-table文本字段未显示在 ng2-smart-table 中
【发布时间】:2019-06-01 13:21:55
【问题描述】:

我正在尝试在 ng2-smart-table 组件的列中显示一个文本字段。 参考ng2-smart-table 文档,但仍然没有显示文本字段。你能帮忙解决这个问题吗? 在 component.ts 文件中:

setting = {
    multimode:true,
    hideSubHeader:true,
    actions: false,
    columns: {
        NAME: 
        {
        title: 'Name'
        },

        VALUE: {
            title: 'Value',
            type:'text',
            editor:{
                type:'text'

            }

         }
        },
        attr: 
        {
        class: 'table table-bordered'
        }
    }

在component.html文件中:

 <ng2-smart-table [settings]="setting" [source]="ConfigureSource" ></ng2-smart-table>

在 ConfigureSource.ts 文件中:

export const ConfigureData: Array<any> = [
        {
                  "Name": "John",
                  "Value": ""

              },
              {
                  "Name": "Sam",
                  "Value": ""
              }

          ];

【问题讨论】:

  • 你能发一个configureSource的例子吗?
  • @EhsanKiani 添加了。

标签: angular ng2-smart-table


【解决方案1】:

尝试设置动作:

动作:{ 编辑:true,位置:'right' }

并且列可编辑为true

【讨论】:

  • @JobyWilsonMathews,如果您将列设置为可编辑 false,它是否仍可编辑?
猜你喜欢
  • 2018-09-21
  • 2019-04-17
  • 2019-04-11
  • 1970-01-01
  • 2020-07-08
  • 1970-01-01
  • 1970-01-01
  • 2019-11-23
  • 2019-01-08
相关资源
最近更新 更多