cursor not-allowed after drop

2 posts, 1 answers
  1. Jason
    Jason avatar
    17 posts
    Member since:
    Mar 2009

    Posted 27 Jan 2010 Link to this post

    Hi,

    I'm using the following client-side script as part of my treeview dragging routine.  It displays the not-allowed cursor when dragging over items that I do not want the user to drop onto.   This works well. 

    However, once the user has dropped the node the html elements retain their not-allowed cursor style. I'm wondering how best to revert all of the items cursor style to pointer once the dragging/dropping routine is finished?

    function ProjAppsTreeView_ClientNodeDragging(sender, args) {  
     
        //Get the target of the element the user is dragging over  
        var target = args.get_htmlElement();  
     
        //If no target variable then exit  
        if (!target) return;  
     
        //Check for the RadGrid Data area.  If found then return else  
        //Display the no drop cursor to feedback to the user that dropping  
        //here is a waste of time.  
        if (target.className == "rgDataDiv") {  
            //Do nothing  
        }  
        else {  
            target.style.cursor = "not-allowed";  
        }  

    Thanks
    Jase
  2. Answer
    Yana
    Admin
    Yana avatar
    5015 posts

    Posted 01 Feb 2010 Link to this post

    Hello Jason,

    You can save the id of the current element which the cursor is dragging over in a javascript variable and then  when the event is fired for the next element,  you can remove the cursor style from the previous one. Please try this approach and let us know how it goes.

    Greetings,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top