extjs4 - 存储中批量插入导致性能问题
从网格复制行并插入到开头的同一网格中(在位置 0 插入)。
一旦命中超过 10 行,就会导致性能问题。我开始使用
store.suspendEvents(true); foreach(..) { r = ... 商店.插入(0, r); } store.resumeEvents();
它提高了性能,因为网格不再随着存储中的每次插入行而刷新。但是由于某种原因,它在索引存储中的行时会抛出异常。我认为因为商店活动被暂停,所以它的状态有些糟糕。
供参考。它再次在最后添加第二行,并抛出异常消息。
欢迎任何有关如何以其他方式处理这种情况的建议。
Copying the rows from the grid and inserting into same grid in begining (insert at position 0).
It was causing performance issue, as soon as hits more than 10 rows. I started using
store.suspendEvents(true);
foreach(..)
{
r = ...
store.insert(0, r);
}
store.resumeEvents();
It improves a performance, as grid is no longer getting refresh with each insert of row in the store. however for some reason it throws exception while indexing the rows in the store. I think because store events are suspended, its going in some bad state.
fyi. its adding second row in the last again, where it throws with exception message.
Any other suggestion on how to handle this situation in any other way is welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该创建一个商店,然后让网格使用该商店。然后,您可以根据需要管理商店,并且数据将自动可供网格使用。像这样的东西:
You should create a store and then have the grid use that store. You can then manage the store as needed and the data will automatically be available to the grid. Something like: