I've been working on a number of sencha touch forms in an app to handle CRUD operations and I can't seem to find the consistency in how data/models/proxy interact.

Most of these forms deal with nested data where there might be a model association like:

  - prop1
  - prop2
  - ModelB
    - prop1
    - prop2
    - prop3
    - hasMany ModelC
    - hasMany ModelD
  - hasMany ModelE
Even though a simple updateRecord() doesn't fill complex objects like the one above, I'm pretty much able to manually handle filling a model with data from a formpanel. That is not the pressing issue.

The difficulty is in figuring out how to get ALL the data output to JSON through the REST proxy. Can anyone explain the rules here? Because I can't seem to figure it out.

If I take an entire data hash representing the object structure above, and I do
myModelA.setData( hugeDataHash )
then when I sync() the model's store with the server, all the data goes.

But if I set the associated data via the associations like this:
myModelA.getModelB().setData( modelBData )
then all of a sudden I just get "modelB:undefined" in the outgoing JSON when I sync() ModelA's store.

Then I flip over to the hasMany associations and they go with the JSON regardless.

How are developers *supposed* to handle Create and Update functionality in forms with complex nested data?