1

我在Kendo UI Window.close()上有两个或更多按钮,这些按钮迟早会在某些业务逻辑之后调用事件。

例如,下面的屏幕:“关闭”按钮将直接关闭窗口,但“保存”按钮将检查某些条件然后触发关闭。

在此处输入图像描述

现在,我已经添加了我的条件

that.bind('close', function(){
     //check some condition
     // here if condition met, let the flow continue else call preventDefault()
});

当两个按钮都被点击时,这个拦截就会触发。如何检查哪个按钮触发了事件?

FYA,我已经扩展了 Kendo UI Window 小部件,因此that.bind()拦截已经到位。

4

2 回答 2

0

尝试在您的函数中添加一个事件,这应该可以让您检查谁在调用该函数。像这样的东西:

that.bind('close', function(e){
         var clickedButton = e.currentTarget || e.target || e.sender;
         //check some condition
         // here if condition met, let the flow continue else call preventDefault()
    });
于 2016-04-05T21:09:11.033 回答
0
$("#closeBtnId").bind("click", function () {

});

$("#saveBtnId").bind("click", function () {

});
于 2016-04-05T14:36:17.160 回答