我正在使用智能表进行角度项目。我有给定的 .html
<ng2-smart-table [settings]="settings" [source]="source" (editConfirm)="onSaveConfirm($event)"
(deleteConfirm)="onDeleteConfirm($event)" >
</ng2-smart-table>
.ts 文件如下
export class CoursesComponent {
settings = {
hideSubHeader: false,
mode: 'inline',
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
//confirmEdit: true,
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
},};
onDeleteConfirm(event): void {
console.log(event.data);
if (window.confirm('Are you sure you want to delete?')) {
event.confirm.resolve();
} else {
event.confirm.reject();
}
}
onSaveConfirm(event): void {
console.log(event.data);
}
}
我想获取表格的编辑数据,但没有得到。ng-smart-table 中的属性如给定
edit: {
inputClass: '',
editButtonContent: 'Edit',
saveButtonContent: 'Update',
cancelButtonContent: 'Cancel',
confirmSave: false,
},
delete: {
deleteButtonContent: 'Delete',
confirmDelete: false,
},
有什么帮助吗?