Hi,
Are there any limitations when executing 'preventDefault()' in the end Callback of the Sortable widget? Below is a snippet of my 'end' callback that Im having trouble with.
end:
function
(e) {
if
(e.oldIndex == e.newIndex) {
e.preventDefault();
return
false
;
}
$.when(promptForDuration())
.done(
function
(result) {
alert("success: " + result)
})
.fail(
function
() {
console.log(e);
e.preventDefault();
return
false
;
});
}
If the old and new index are the same, the 'preventDefault()' works fine, rolling back any chages made by the user. However if they are not the same I've created a custom KendoWindow to prompt for a new duration to be entered and returned using deferred promises (not sure if I've described that right).
The 'fail' callback is triggering and the console.log is printing the sortable event info:
Object {
_defaultPrevented:
true
,
action:
"sort"
,
draggableEvent: Object,
isDefaultPrevented: (),
item: A.fn.init[1],
newIndex: 1,
oldIndex: 0,
preventDefault: (),
sender: init,
__proto__: Object }
But still the 'preventDefault()' is not either not running or not having an affect of the Sortable widget.
Please advise on how this can be resolved.
Kind Regards,
Grant