【问题标题】:how to undo the action DayPilot.Scheduler on event Resized without reloading the page?如何在不重新加载页面的情况下撤消对事件调整大小的 DayPilot.Scheduler 操作?
【发布时间】:2015-07-05 17:07:51
【问题描述】:

如何撤消对事件Resized 的操作DayPilot.Scheduler 在我保存的最后一个事件上而不重新加载页面?

这是我的代码:

dp.onEventResized = function (args) {
    if (confirm('Are you sure you want to edit this?')) {
        --do some code --
    }
    else
    {             
        window.location.reload();
        //undo the last event..
    }
};

【问题讨论】:

    标签: javascript jquery daypilot


    【解决方案1】:

    您应该使用 onEventResize 来显示确认对话框。此事件在默认操作之前调用(而 onEventResized 在其之后调用)。您可以使用 args.preventDefault() 取消默认操作:

    dp.onEventResize = function (args) {
      if (!confirm('Are you sure you want to edit this?')) {
      {             
        args.preventDefault();
      }
    };
    

    将原始操作保留在 onEventResized 处理程序中:

    dp.onEventResized = function (args) {
       // submit changes
    };
    

    【讨论】:

    • 先生。是否可以使用 args.preventDefault(); onEventMove 取消操作?
    猜你喜欢
    • 1970-01-01
    • 2011-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-14
    • 2016-09-04
    • 1970-01-01
    • 2011-10-31
    相关资源
    最近更新 更多