This is a migrated thread and some comments may be shown as answers.

cursor not-allowed after drop

1 Answer 135 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 27 Jan 2010, 09:47 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 01 Feb 2010, 03:13 PM
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.
Tags
TreeView
Asked by
Jason
Top achievements
Rank 2
Answers by
Yana
Telerik team
Share this question
or