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

setValid(false) doesn't prevent a drop

1 Answer 152 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 04 Aug 2015, 06:18 PM

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!

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 05 Aug 2015, 02:09 PM

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!
 
Tags
TreeView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or