Closed Lorless closed 7 years ago
I guess that you have a nested tree structure. This isn't covered by this control's implementation and you have to handle it yourself.
Some ways to iplement this would be:
parent()/closest()
to climb up the tree and then use .scope()
to retrieve the element's modeldropTargetModel
arrrayThanks. Thats helpful :)
@thgreasi On a related note, this question required that the validation be performed before the drop takes place. Ideally on the 'over' callback but the dropTarget does not seem to be populated. Is that correct or have i messed up somewhere?
Yea, the dropTarget is populated after the drop. You can use the ui
parameter of the over
callback following the jQuery UI API for such a specific use case.
I have a use case where certain objects shouldn't be allowed inside certain containers. This is denoted by the 'selectorType' field on the object.
The problem is that the dropTargetModel is the actual array im dropping into and not the parent object so I can't check what the parent type is, only the siblings. Is there any way around this?