SortableJS / meteor-sortablejs

Reactive reorderable lists.
http://rubaxa-sortable.meteor.com
19 stars 10 forks source link

Ability to override, cancel, preventDefault(), stopPropagation(), etc for onAdd insertion #6

Open jowilhnson opened 8 years ago

jowilhnson commented 8 years ago

Users need to be able to have some control over what the package attempts to do to their Collections. Being able to write custom onAdd functions are only so useful when there's no way to stop the default attempt at inserting a new document into the collection.

var newElementId = templateInstance.collection.insert(event.data);

That line causes problems, and often times is not the desired behavior. evt.stopPropagation(), evt.preventDefault(), and evt.cancelBubble = true all have no effect.