简体   繁体   中英

Is there any way to make a bulk update in meteor?

I'm trying to order a reactive list of items with drag and drop. Each time the list is reordered, an object with the position of each element sent to the server.

At the server, for each object an update is executed with the new position of element.

But this way, at each update, the entire list is again rendered.

Is there any way to pause the reactivity until completion of all updates?

Thanks in advance for any help you are able to provide.

Added: Do not reactive sort on update in Meteor

What you describe isn't standard behavior. They worked really hard to make things nicer.

Make sure each document area has a unique id in the dom.

<div id="books_{{_id}}">

Whatever you are sorting on, if moving something from the 8th position to the 3rd makes the 4th to 8th get renumbered, try a different technique. Assign numbers with a large gap. Like 10,20,30,40. Then, to reposition 80 to 3rd, just give record sort order 80 a sort order 25, half way between the other two. Combined with the unique ids, things are designed to be pretty efficient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM