简体   繁体   English

如何在SPA客户端行中删除与服务器的持久性存储网格中的同步

[英]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.

相关问题 如何同步服务器端和客户端代码? - How do you synchronize server-side and client-side code? 您是否需要服务器的客户端脚本才能访问本地存储? - Do you need client-side script for a server to access local storage? 在HTML5客户端存储中,您如何获得密钥的价值? - In HTML5 client-side storage how do you get the value of the key? 您如何判断网页是客户端渲染还是服务器端渲染 - How do you tell if a web page is client-side or server-side rendering 如何使用服务器上的 Node 从客户端 JavaScript 上传到 Google Cloud Storage? - How do I upload to Google Cloud Storage from client-side JavaScript, with Node on the server? 具有指定到期时间的持久客户端数据存储 - Persistent client-side data storage with specified expiration 是否有任何方法可以通过网络拥有持久的(无论大小)客户端存储? - Is there any way to have persistent (regardless of how small) client-side storage via the web? 将客户端 javascript 时钟与服务器日期同步的最佳方式 - The best way to synchronize client-side javascript clock with server date TypeScript:如何测试客户端代码? - TypeScript: How do you test your client-side code? 客户端(持久)存储 - Client side (persistent) storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM