[英]How do you synchronize in an SPA client-side row deletes in a grid with the server's persistent storage
I'm looking for a general approach for implementing synchronizing client-side row deletes in a grid in a single page app with the server back end. 我正在寻找一种用于在单页应用程序的网格中实现与服务器后端同步客户端行删除的通用方法。
I'm currently exploring the Knockout/breeze/durandal/Wep API eco system, and I like it a lot but no demo, tutorial or documentation mentions or suggests an implementation or preferred solution for syncing row delete's in batch. 我目前正在探索Knockout / breeze / durandal / Wep API生态系统,我非常喜欢它,但没有演示,教程或文档提及,也不建议用于批量同步行删除的实现或首选解决方案。 There are dozens of client side libraries, frameworks and GUI widgets and all of them stating vaguely '... and then you send it to the server'. 有许多客户端库,框架和GUI小部件,它们都含糊地说“ ...然后将其发送到服务器”。
If I have simply not found the right documentation, would somebody kindly point me to this? 如果我根本找不到合适的文档,那么有人可以指出吗?
Am I supposed to implement all this stuff myself (seems a bit backward) or is this scenario already sufficiently covered with current frameworks and tools? 我是否应该亲自实现所有这些功能(似乎有些倒退),或者当前的框架和工具已经充分涵盖了这种情况?
(And yes, I'm completely new to single page applications). (是的,我是单页应用程序的新手)。
Thanks. 谢谢。
When you set a Breeze entity to a "deleted" state 当您将微风实体设置为“已删除”状态时
myEntity.entityAspect.setDeleted()
Breeze automatically detaches it from any collections from which it is a member. Breeze会自动将其与成为其成员的任何集合分离。 At this point the entity will have an EntityState of "Deleted". 此时,实体的EntityState为“已删除”。
Later when the entity ( or entities) are saved via an EntityManager.saveChanges() call, these entities are then both deleted on the server and "detached" (removed from the EntityManager) on the client. 稍后,当通过EntityManager.saveChanges()调用保存一个或多个实体时,这些实体将同时在服务器上删除和在客户端“分离”(从EntityManager中删除)。
At this point the Entity will have an EntityState of "Detached" and should be garbage collected once you release any of your own references to it. 此时,该实体的EntityState将为“已分离”,并且一旦释放您自己的任何引用,就应该对其进行垃圾回收。 ( Breeze no longer "knows" about it. ) (Breeze不再“知道”它。)
Is there something in addition to this that you would expect? 除此之外,您还有其他期望吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.