This question is locked. New answers and comments are not allowed.
I need to verify the drop is valid or not using ajax call and if it is not valid drop i need to prevent.
Even if my ajax call return false i cant able to stop from dropping. Please help me to fix this issue ASAP.
here is my code
function onNodeDrop(e) {
var treeview = $('#TreeView').data('tTreeView');
var nodeText = treeview.getItemText(e.item);
var nodeValue = treeview.getItemValue(e.item);
var dropNodeText = treeview.getItemText(e.destinationItem);
var dropNodeValue = treeview.getItemValue(e.destinationItem);
var ManageCategory = { SourseNodeText: nodeText, SourceNodeValue: nodeValue, DestinationNodeText: dropNodeText, DestinationNodeValue: dropNodeValue };
$.ajax({
url: '@Url.Action("Manage", "GroupsAndEvents")',
data: ManageCategory,
type: 'POST',
contentType: 'application/x-www-form-urlencoded',
success: function (data) {
if (data.Status == false) { // Its coming inside of this if block but its not working
e.preventDefault();
}
}
});
}
Even if my ajax call return false i cant able to stop from dropping. Please help me to fix this issue ASAP.
here is my code
function onNodeDrop(e) {
var treeview = $('#TreeView').data('tTreeView');
var nodeText = treeview.getItemText(e.item);
var nodeValue = treeview.getItemValue(e.item);
var dropNodeText = treeview.getItemText(e.destinationItem);
var dropNodeValue = treeview.getItemValue(e.destinationItem);
var ManageCategory = { SourseNodeText: nodeText, SourceNodeValue: nodeValue, DestinationNodeText: dropNodeText, DestinationNodeValue: dropNodeValue };
$.ajax({
url: '@Url.Action("Manage", "GroupsAndEvents")',
data: ManageCategory,
type: 'POST',
contentType: 'application/x-www-form-urlencoded',
success: function (data) {
if (data.Status == false) { // Its coming inside of this if block but its not working
e.preventDefault();
}
}
});
}