简体   繁体   English

我可以在ExtJS4中将带有Rest Proxy的商店转换为带Memory Proxy的商店吗?

[英]Can I make Store with Rest Proxy convert to Store with Memory Proxy in ExtJS4?

I have a Store with the Rest Proxy. 我有一家带有Rest Proxy的商店。 In my case, i want to make it from rest proxy with data convert to memory proxy with origin data, and in memory proxy mode, i will modify some record and save it which doesn't need to save to Server. 在我的情况下,我想将其从具有数据的其余代理转换为具有原始数据的内存代理,在内存代理模式下,我将修改一些记录并将其保存,而无需保存到服务器。

var store = Ext.create('Ext.data.Store', {
    model: 'my_rest_model',
    autoLoad: true
}

is there are any method can convert it to store with memory proxy? 有什么方法可以将其转换为使用内存代理存储?

You don't need to do that. 您不需要这样做。 A store doesn't need to write anything back to the server. 商店不需要将任何内容写回到服务器。 As long as you do nothing to trigger it, by either: 只要您不执行任何操作来触发它,请执行以下任一操作:

  • Syncing the store (manually or with the autoSync config) 同步存储(手动或使用自动同步配置)
  • Calling save on the model directly 直接在模型上调用保存

It won't write anything back to the server. 它不会将任何内容写回到服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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