2

我正在尝试通过拖放来订购反应性项目列表。每次对列表重新排序时,都会将带有每个元素位置的对象发送到服务器。

在服务器上,对于每个对象,都会使用元素的新位置执行更新。

但是这样,在每次更新时,都会再次渲染整个列表。

有什么方法可以暂停反应直到所有更新完成?

提前感谢您提供的任何帮助。

4

1 回答 1

0

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.

于 2013-09-06T01:07:29.113 回答