1. #1
    Sencha User
    Join Date
    Nov 2013
    Posts
    6
    Vote Rating
    1
    Answers
    1
    snowman002000 is on a distinguished road

      0  

    Default Answered: how to change icon when dragging a tree node?

    Answered: how to change icon when dragging a tree node?


    I want to show the NO-DROP icon when the items are dragged over some special tree nodes instead of showing other icons as if the action was allowed.
    QQ截图20140114152656.png => QQ截图20140114152708.png
    How to change the icon?
    Thanks.

  2. Well, I turned to another way to solve this problem.
    There is no need to care about changing icon.
    What I actually have to do is to set whether the drop action is allowed, and ExtJs will show the correct icon for me automatically.
    So I bind the "nodedragover" method:

    onNodeDragOver: function(targetNode, position, dragData, e, eOpts)
    {
    var dragNode = dragData.records[0];
    var canDrop = true;
    if(...) // Make your condition
    {
    canDrop = false;
    }
    return canDrop;
    }

    But if you know how to change icon when dragging, I'd like to know

  3. #2
    Sencha User
    Join Date
    Nov 2013
    Posts
    6
    Vote Rating
    1
    Answers
    1
    snowman002000 is on a distinguished road

      0  

    Default


    Well, I turned to another way to solve this problem.
    There is no need to care about changing icon.
    What I actually have to do is to set whether the drop action is allowed, and ExtJs will show the correct icon for me automatically.
    So I bind the "nodedragover" method:

    onNodeDragOver: function(targetNode, position, dragData, e, eOpts)
    {
    var dragNode = dragData.records[0];
    var canDrop = true;
    if(...) // Make your condition
    {
    canDrop = false;
    }
    return canDrop;
    }

    But if you know how to change icon when dragging, I'd like to know

Tags for this Thread