我正在使用ng2-smart-table,目前在编辑模式方面遇到问题。它支持多行编辑,但是我只希望它仅编辑1行,而其他行则被禁用,直到退出该行的编辑模式为止。
这是一个很明显的问题,但是我在任何地方都找不到答案。如何在表格中实现此功能?
以下是我的表格设置:
settings = {
hideSubHeader: true,
actions: {
columnTitle: 'Edit/Delete',
add: false,
position: 'right'
},
edit: {
confirmSave: true,
confirmEdit: true,
editButtonContent: '<img src="../../../assets/images/pencil.png" width="20" height="20">'
},
delete: {
confirmDelete: true,
deleteButtonContent: '<img src="../../../assets/images/delete.png" width="20" height="20">'
},
columns: {
index: {
title: 'No',
filter: false,
editable: false,
valuePrepareFunction(value, row, cell) { return cell.row.index + 1; }
},
categoryname: {
title: 'Category name',
filter: false
},
color: {
title: 'Color',
filter: false,
type: 'custom',
renderComponent: ColorLabelComponent,
editor: {
type: 'custom',
component: ColorGetterComponent
}
},
note: {
title: 'Note',
filter: false
}
}
};