setValid(false) doesn't prevent a drop

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    5 posts
    Member since:
    Jan 2015

    Posted 04 Aug 2015 Link to this post

    I am using Kendo UI 2005 Q2 release (v2015.2.624) with Angular JS. I have the following drop event handler to prevent an in valid drop based on the destination node type.

             $scope.onDropTreeNode = function (e)
            {
                var destinationNode = $("#ruleTreeView").data("kendoTreeView").dataItem(e.destinationNode);
                
                if(destinationNode.nodeType != 3)
                {
                    console.debug("Can't drop in node type: " + destinationNode.nodeType);
                    e.setValid(false);
                    console.debug(e);
                }
            }

    The event handler is invoked as expected, the IF statement executed, and both console.debug statements print out the debugging message/object content. I can see that the "valid" data field is set to false in the event object:

    Object {originalEvent: MouseEvent, sourceNode: li#ruleTreeView_tv_active.k-item.ng-scope, destinationNode: li.k-item.ng-scope, valid: false, dropTarget: span.k-in.k-state-hover…}

    HOWEVER, the Tree View control still allows the drop even though the valid == false. I was expecting the drop to be reverted after e.setValid(false).

    By the way, this is running in Chrome Version 44.0.2403.130 m (64-bit).

    I am facing a tight deadline, so any help is much appreciated!

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 05 Aug 2015 Link to this post

    Hello Daniel,

    This bug was resolved in the latest internal builds, and is included in the Q2 SP1, which is released today.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top