无法在 ng2-smart-table 中获取保存数据事件
Unable to get save data event in ng2-smart-table
我正在使用 ng2-smart-table
来维护我的 angular 6 应用程序中的数据。正如我在 git 和 npm 页面中看到的那样。我已经这样设置了我的代码。
<ng2-smart-table
[settings]="settings"
[source]="characters"
(createConfirm)="onCreateConfirm($event)">
我可以通过调用 API 在 table 中加载数据。但是当我无法获得保存数据事件时。为此,我设置了这样的功能。
onCreateConfirm(event) {
alert("Clicked...");
}
我在ngOnInit
下设置了这个功能。
这是一个常见问题,您需要在配置对象中设置 confirmCreate 属性,如下所示:
export const settings= {
delete: {
confirmDelete: true,
...
},
add: {
confirmCreate: true,
...
},
edit: {
confirmSave: true,
...
},
....
我正在使用 ng2-smart-table
来维护我的 angular 6 应用程序中的数据。正如我在 git 和 npm 页面中看到的那样。我已经这样设置了我的代码。
<ng2-smart-table
[settings]="settings"
[source]="characters"
(createConfirm)="onCreateConfirm($event)">
我可以通过调用 API 在 table 中加载数据。但是当我无法获得保存数据事件时。为此,我设置了这样的功能。
onCreateConfirm(event) {
alert("Clicked...");
}
我在ngOnInit
下设置了这个功能。
这是一个常见问题,您需要在配置对象中设置 confirmCreate 属性,如下所示:
export const settings= {
delete: {
confirmDelete: true,
...
},
add: {
confirmCreate: true,
...
},
edit: {
confirmSave: true,
...
},
....