I am trying to implement drag and drop rows in two grids in both way. It is possible in both direction, to and fro. But my delete is not working. Here is my script. anybody can help to get deleted.
<script type="text/javascript">
function onRowDropping(sender, args) {
if (sender.get_id() == "<%=grdPendingOrders.ClientID %>") {
var node = args.get_destinationHtmlElement();
if (!isChildOf('<%=grdShippedOrders.ClientID %>', node) && !isChildOf('<%=grdPendingOrders.ClientID %>', node)) {
args.set_cancel(true);
}
}
else if (sender.get_id() == "<%=grdShippedOrders.ClientID %>") {
var node = args.get_destinationHtmlElement();
if (!isChildOf('<%=grdPendingOrders.ClientID %>', node) && !isChildOf('<%=grdShippedOrders.ClientID %>', node)) {
args.set_cancel(true);
}
}
else {
var node = args.get_destinationHtmlElement();
if (!isChildOf('trashCan', node)) {
args.set_cancel(true);
}
else {
if (confirm("Are you sure you want to delete this order?"))
args.set_destinationHtmlElement($get('trashCan'));
else
args.set_cancel(true);
}
}
}
function isChildOf(parentId, element) {
while (element) {
if (element.id && element.id.indexOf(parentId) > -1) {
return true;
}
element = element.parentNode;
}
return false;
}
</script>