ExtJS 4 and store.save () associations

I am using ExtJS 4 and have a model with hasMany association.

ModelA -> hasMany -> ModelB 

I use GridA to display data from ModelA. When I click on a record in GridA, I use the rowSelect event to create GridBs that use ModelA.ModelB () as storage.

Everything goes well until I change the entry in ModelB. The record is updated in the hierarchy, but when I execute the StoreA.save () function, no changes are returned to the server. He does not notice changes in associations. How to save this data without breaking into the architecture?

I expect the model to be able to save, exactly as it loads.

Also, when I change a record in ModelA, it returns only as ModelA, not ModelA-> ModelB, even if this record has ModelB data.

thanks

+4
source share
2 answers

Yes, I don’t think that this entire hierarchy of the model is fully operational to the level you expected. You can assume that only those things that this Doc talked about work: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Model

+1
source

The model relationship is not yet fully implemented, and ExtJS 4.1 does not make any improvement in the implementation, except for a few important bug fixes. To learn more, check out my blog at http://blog.neolocus.com/2011/12/extjs-4-and-model-associations/

+1
source

Source: https://habr.com/ru/post/1387534/


All Articles