I have a page with Radtreeview enable drag & drop. I implement a radconfirm to check exist node name when drop nodes
Script on client node dropping
And code to call confirm :
Code of RadAjaxManager1_AjaxRequest
But when drop an item on Radtreeview to another Node that the same node name, RadTreeView_NodeDrop event always fire before RadAjaxManager1_AjaxRequest. How to solve it?
Script on client node dropping
function onNodeDropping(sender, args) { var dest = args.get_destNode(); var source = args.get_sourceNode(); if (dest) { var result = false; for (var i = 0; i < dest.get_nodes().get_count() ; i++) { var node = dest.get_nodes().getNode(i); if (node.get_text() == source.get_text()) { result = true; break; } } if (result) { callConfirm(source.get_text()); return; } } else { dropOnHtmlElement(args); } }And code to call confirm :
function callConfirm(nodeText) { radconfirm(nodeText + ' folder is existing, Do you want to overwrite?', confirmCallBackFn); return false; } function confirmCallBackFn(arg) { var ajaxManager = $find("<%=RadAjaxManager1.ClientID%>"); if (arg) { ajaxManager.ajaxRequest('ok'); } else { ajaxManager.ajaxRequest('cancel'); }Code of RadAjaxManager1_AjaxRequest
if (e.Argument.ToString() == "ok") { lbStatus.Text = "OK"; } else if(e.Argument.ToString() == "cancel") { lbStatus.Text = "Cancel"; }But when drop an item on Radtreeview to another Node that the same node name, RadTreeView_NodeDrop event always fire before RadAjaxManager1_AjaxRequest. How to solve it?