ember-drag-drop
ember-drag-drop copied to clipboard
Question regarding validation
Great addon!
Bit of a ember component novice and I'm wondering how I could go about validating the drop event based on the contents of the model and then cancel it if certain parameters are no met.
Thanks!
Great question. Right now I don't think so, but that kind of hook is definitely needed. I'll check it out.
Thanks for the issue!
Just adding that I'd be very keen to see this implemented. I.e. for each draggable object, to be able to specify the allowed draggable targets (or vice-versa ... for a target, specify the allowed draggables). It could be as complex as a full-blower validator ... or it could be as specifying a droppable key e.g. "posts" which would dictate that only draggable objects with key="posts" can be dropped into targets with key="posts" (and it's the user's responsibility to set these keys beforehand, which essentially makes this equivalent to validators).