本文介绍了填充网格和形式与相同的json?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用某些JSON数据填充网格以及与其他JSON格式的格式?两个商店或两个型号或两者?简单的例子...; - )

Is it possible to populate grid with some of the JSON data and a form with other, from the same JSON? Two stores or two models or both? simple example... ;-)

推荐答案

是的,最好的方法是操纵读者,以及返回的记录,也存储从服务器发送的原始json的任何东西。

Yes, the best way to do this would be to manipulate the reader, which as well as returning records, also stores whatever the raw json sent from the server is.

最简单的解决方案是为网格指定读取器参数,但是具有监听器,然后处理属性从读者获取您的表单的附加值。

The easiest solution would be to specify the reader parameters for your grid, but then have a listener on the store, which then processed the rawData property from the reader to get the additional values for your form.

当然,如果您的表单数据与网格数据相关,你可能会更好地依靠嵌套加载和在商店的加载事件处理程序中。请参阅Ext示例(表单和网格数据绑定示例),以执行此操作。

Of course if your form data is related to the grid data, you may do better to rely on nested loading and form.loadRecord in the store's load event handler. See the Ext samples (form and grid data binding example) for wasy of doing this.

根据情况,另一种类似于将通过一个简单的Ext.Ajax.Request来处理Ajax,这个过程通过两个json商店与本地代理商,但这似乎并不像Ext4数据模型对我友善。

Depending on the circumstances, another approach similar to the Ext FAQ would be to handle the Ajax through a simple Ext.Ajax.Request, and this process the json through two stores with local proxies, but this doesn't seem quite so Ext4 data model friendly to me.

这篇关于填充网格和形式与相同的json?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 15:33