问题描述
在EJ2 Schedule组件上,我想发送一个HTTP请求,如果请求失败,则将事件恢复到其原始位置。在onDragStop
方法中,如果立即将event.cancel
设置为true
,它将取消拖动事件,但是如果我发送HTTP请求并等待其响应,则无法取消它。>
onDragStop(event: DragEventArgs) {
const isWorking: boolean = this.isWorking();
if (isWorking) {
this.scheduleService
.editAppointment(this.scheduleData)
.toPromise()
.catch(err => {
event.cancel = true; // This line does not cancel the drag event
});
} else {
event.cancel = true;
}
}
https://stackblitz.com/edit/angular-9-schedule-abzrii
能否请您帮我解决如何在HTTP请求后将拖动项恢复到其原始位置?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)