I am doing a drag and drop from a grid onto the treeview. All is well, events are hooking up and I am getting all the data I need to make it work. But I have one issue. After the row from the grid is dragged on to the treeview node, I display a context menu that will allow the user to select the action they would like to perform with the dragged item on the node.
I have the context menu showing in the correct place, however it quickly closes again so that the user cannot select any of the menu items.
The code which show the menu:
function onRowDropping(sender, args) { if (currentNode) { //Check to see if this is a valid drop var draggedrow = args.get_draggedItems()[0]; var dragedentitytype = draggedrow.getDataKeyValue('EntityID'); var dragentityid = draggedrow.getDataKeyValue('cplID'); var dropenitytype = currentNode.get_attributes().getAttribute('EType'); args.set_cancel(true); //Cancel the drop, will be handled by menu item, also prevent grid from auto refreshing var tree = $find("<%=RadTreeStandards.ClientID %>"); currentNode.set_selected(true); tree._contextMenuNode = currentNode; var menu = tree.get_contextMenus()[1]; menu.show(args.get_domEvent()); } else { args.set_cancel(true); } } var currentNode = null; function onNodeMouseOver(sender, args) { //gets the node upon mousing over the node currentNode = args.get_node(); } function onNodeMouseOut(sender, args) { //resets the currentNode value upon mousing out currentNode = null; }
It seems that some event is occurring that I can't cancel that closes the menu?
Thanks,
Bryan Kowalchuk