ExtJS的4协会和store.save() [英] ExtJS 4 associations and store.save()
问题描述
我使用ExtJS的4,并与定义关联的hasMany的典范。
I am using ExtJS 4, and have a model with an association hasMany defined.
ModelA -> hasMany -> ModelB
我用GridA显示来自MODELA数据。在点击GridA的记录,我用rowSelect事件创建GridB它们使用ModelA.ModelB()作为存储。
I use GridA to show the data from ModelA. On clicking a record in GridA, I use a rowSelect event to create GridB which use ModelA.ModelB() as a store.
这一切都很好,直到我改变ModelB记录。该记录确实在层次结构得到更新,但是,当我执行StoreA.save(),不变更被发送回服务器。它没有注意到在关联的变化。如何保存这些数据,没有黑客的架构?
It all goes well until I change a record in ModelB. The record does get updated in the hierarchy, but when I execute StoreA.save(), no change is sent back to the server. It does not notice the changes in associations. How do I save this data, without hacking the architecture?
我期待的模型能够保存,正是它加载的方式。
I am expecting the Model to be able to save, exactly the way it loads.
此外,当我改变MODELA的记录,它被送回因为只有MODELA而不是ModelA-> ModelB,即使该记录有ModelB数据。
Also when I change a record in ModelA, it gets sent back as only ModelA and not as ModelA->ModelB, even when that record has ModelB data.
感谢
推荐答案
示范的关系没有得到很好的落实着呢,ExtJS的4.1不作出有关实施任何改进或者,以上几个重要的bug修复等。要了解更多信息请查看我的博客 HTTP://blog.neolocus .COM / 2011/12 / ExtJS的-4和模型协会/
Model relations are not well implemented yet, and ExtJS 4.1 is not making any improvements on the implementation either, other than a few important bug fixes. To learn more check my blog at http://blog.neolocus.com/2011/12/extjs-4-and-model-associations/
这篇关于ExtJS的4协会和store.save()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!