javascript - Restrict dropPosotion before and after Kendo UI treeview -
when doing drag , drop in kendo ui treeview has 3 positions namely "before", "over" , "after".
is possible restrict "before" , "after" states , allow drop "over" functionality.
note
in scenario have 2 trees , i'm dragging element left tree other.
in kendotreeview
, define drag
, drop
event handlers follow:
drag : function (ev) { if (!$(ev.droptarget).hasclass("k-in k-state-hover")) { ev.setstatusclass("k-denied") } }, drop : function (ev) { if (ev.sourcenode === ev.destinationnode) { ev.setvalid(false); } }
in drag
check over element , if not set status class k-denied
formats clue
denied prevents dropping there.
in drop
check i'm not dropping on top of preventing stack overflow.
running example here: http://jsfiddle.net/onabai/mu92b/
Comments
Post a Comment