每当我向表中添加新数据时,表应自动加载。数据被加载到数据库。但是该表不会更新。有没有办法做到这一点?
<ng2-smart-table [settings]="progressTable_Config"
[source]="progressTableSource"
(createConfirm)="addProgressRecord($event)"
(deleteConfirm)="onDeleteConfirm($event)">
progressTable_Config = {
add: {
addButtonContent: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmCreate: true,
},
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmEdit: false,
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
confirmDelete: true,
},
actions: {
add: true,
edit: false,
delete: false,
},
columns: {
progress_date: {
title: 'Date',
type: 'date',
filter: false
},
progress_percent: {
title: 'Percentage Completed(%)',
type: 'integer',
filter: false,
},
note: {
title: 'Note',
type: 'string',
filter: false
},
},
};
答案 0 :(得分:1)
如果您想刷新,此代码可能会帮助您
this.progressTableSource.refresh();
或
this.progressTableSource.empty();
this.progressTableSource.refresh();
this.progressTableSource.load(this.data);