PDA

View Full Version : How to use hasMany association with multiple lists and stores?



1chiban
31 Aug 2011, 8:19 AM
Hi, I have a question as the topic suggests. In my web application i got 4 classes which are related to each other so a "class 1" object has many "class 2" objects inside, a "class 2" object has many "class 3" objects inside and so on.

So to do this, i've used the hasMany attribute in the model declaration of every class except for the terminal class.

I also have a store using the class 1 model so when i load this store with the json file i've created, all the "class 1" objects appear with an array of "class 2" objects inside. The problem is, that array is empty. How should I do to make them appear? On the declaration of the "class 2" model i have a id_class1 attribute which i think it should make the association work no? Thanks in advance.:-?