Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

Overwriting iter-list move in meteor

Open mquandalle opened this issue 11 years ago • 5 comments

Hello,

I'm switching the LibreBoard application (made with meteor) from jquery-ui to Sortable. In this application we have cards and lists, and every card is in a list. When the user move a card from list A to B, I don't want to create a new card and remove the old one, but instead I want to update the listId field of the card document.

I tried with onAdd event, which works, but I cannot stop the default behavior from there (I tried event.stopPropagation() which does not work); so immediately after my update happen there is an error in the console saying that the insertion failed because of duplicate _id.

What is the canonical way to update a document after an inter-list move in meteor?

cc @dandv

mquandalle avatar Jan 27 '15 14:01 mquandalle

I think this is related to the react linked lists issue: https://github.com/RubaXa/Sortable/issues/217 . I think we need a way to pass a js method which could update document/application state instead of modify the dom directly.

mtetlow avatar Jan 27 '15 14:01 mtetlow

Hum it seems that there is no way to avoid this line https://github.com/RubaXa/Sortable/blob/master/meteor/reactivize.js#L157 that does this insertion. And yes @mtetlow I believe in this case sortable should not try to update the DOM.

mquandalle avatar Jan 27 '15 14:01 mquandalle

+1

andruschka avatar Feb 17 '15 13:02 andruschka

Hi, did this get resolved? Is there an example of moving an item from List A to List B in Meteor, pls?

adamgins avatar Jul 18 '15 23:07 adamgins

Dear all! Meteor is moved to the separate repository. If this issue is still actual, please create it there once again.

For your info: this project needs a maintainer.

RubaXa avatar Feb 05 '16 20:02 RubaXa