Reputation: 640
My kendo scheduler contains a remove event
..
e.Remove("scheduler_remove");
})
and the function is
function scheduler_remove(e){
$.ajax({
url: '@Url.Action("ValidateTaskForAddingBreak", "Home")',
type: "POST",
success: function (da) {
alert("im a success");
}
}
}
The problem is, that it is making the ajax call before the task is removed. I have also tried to use the e.DataBound
, or e.DataBinding
, but it will be called several places where it should not be called then.
Is there a way to let the event happen first, and then get to the ajax call ?
Upvotes: 0
Views: 630
Reputation: 640
I found a way to do it:
If i added a timeout for it, it would be called after the event had finished
function scheduler_remove(e) {
setTimeout(function () {
$.ajax({
url: '@Url.Action("ValidateTaskForAddingBreak", "Home")',
type: "POST",
success: function (da) {
alert("im a success");
}
});
}, 500);
}
Upvotes: 1