IgniteUI / ignite-ui

Ignite UI for jQuery by Infragistics

Home Page:https://bit.ly/2kuu1fT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The igTree nodeDropping and nodeDropped events should expose the tree in its arguments

Lipata opened this issue · comments

Is your feature request related to a problem? Please describe.

The igTree nodeDropping and nodeDropped events should expose the tree (ui.owner) in its arguments, like in the other events (like nodeExpanded)

Describe the solution you'd like

Expose tree in the arguments

@PlamenaMiteva @Lipata
dragStart and nodeDropping/ed already have ui.data exposed, which needs to be adjusted for scenarios where the default copy behavior can't handle. It's just the events trigger with a separately generated node. Would be nice if manipulating the data in those events can be reflected back to the Tree drag & drop.

Just as FYI, besides the owner, we ended up exposing sourceNode to the nodeDropping/ed. So when dropping a node its child collection can be copied if needed.

To copy a node with its children between igTree-s, the sourceNode data can be extended like so on drop:

nodeDropping: function (event, ui) {
ui.sourceNode.data = $.extend(true, {}, ui.sourceNode.data);
}