javascript - Restrict dropPosotion before and after Kendo UI treeview -


when doing drag , drop in kendo ui treeview has 3 positions namely "before", "over" , "after".

http://docs.kendoui.com/api/web/treeview#dragend

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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -