[英]Textfield not displaying in ng2-smart-table
I am trying to display a textfield in a column of ng2-smart-table component. 我正在尝试在ng2-smart-table组件的列中显示一个文本字段。 Referred ng2-smart-table documentation but still textfield is not showing.
请参阅ng2-smart-table文档,但仍未显示文本字段。 Could you please help to solve this issue.
您能帮忙解决这个问题吗?
In component.ts file:
在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'
}
}
In component.html file: 在component.html文件中:
<ng2-smart-table [settings]="setting" [source]="ConfigureSource" ></ng2-smart-table>
In ConfigureSource.ts file: 在ConfigureSource.ts文件中:
export const ConfigureData: Array<any> = [
{
"Name": "John",
"Value": ""
},
{
"Name": "Sam",
"Value": ""
}
];
try to set the actions: 尝试设置操作:
actions: { edit: true, position: 'right' }
动作:{编辑:正确,位置:“正确”}
and the column editable to true 并且该列可编辑为true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.