我已经开始使用koGrid了。我想在koGrid中隐藏一个特殊列'id'。我可以这样做吗?
gridOptions : {
displaySelectionCheckbox: false,
data: items,
multiSelect: false,
enableColumnResize: true,
columnDefs: [
{ field: 'id', displayName: 'id' },
{ field: 'name', displayName: 'Name' }
]
}
答案 0 :(得分:4)
您可以将visible
option on the columnDefs
设置为false
:
columnDefs: [
{ field: 'id', displayName: 'id', visible: false },
{ field: 'name', displayName: 'Name' }
]
或者,如果您在任何地方都不需要id
值(因此您没有在模板中使用,或过滤排序等),您可以省略整个{ field: 'id', displayName: 'id' }
。