I am using a remove
method to emit a value to store. But getting an error as
error TS2322: Type 'void' is not assignable to type 'Promise<void> | JQueryPromise<void>'.
- how to fix this?
here the sample what i use:
https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/CRUDOperations/Angular/Light/
here is my ts code :
ngOnChanges() {
if (!this.subsystems) { return; }
this.dataSource = new CustomStore({
key: 'Id',
load: (loadOptions) => this.loadData(loadOptions),
update: (key: number, values) => this.updateData(key, values),
remove: (key) => this.removeData(key) //getting error here
});
}
loadData(loadOptions) {
return new Promise((resolve, reject) => {
this.dataGrid.columns = this.columns;
resolve({ data: this.subsystems, totalCount: 10 });
});
}
removeData(key: any) {
this.deleteId.emit(key);
}