PDA

View Full Version : Loading associated stores into a grid



AssetWorks
2 Mar 2013, 12:44 PM
Main model > has many combo model > has many child model
I have a grid that I need to do the following...

For every combo that I have I need to load all of the child model data.

I can see all the data when i debug. I just can't bind it to the grid

Here is what my XML looks like


<main>
...
<combos>
<combo>
<child>
<child>
<combo>
<child>
<child>
<combo>
<child>
<child>

I have the models working fine. I can get a handle on the associated stores I just need a way to bind all the data coming back
I tried doing

Grid.bindstore(combo store);
But it does not load the child data

Any help would be appreciated

mitchellsimoens
4 Mar 2013, 8:26 AM
The child data isn't part of the record's data if the association is working. In a column renderer you could grab the associated data and return some HTML depending on your needs.

AssetWorks
4 Mar 2013, 9:17 AM
Well I also tried


Combostore.each(function (r){
Childstore = r.child();
Childstore.each(function (cr){
Grid.bindstore(childstore);
})
})


But the only thing that it shows is the third iteration of the record and not the first two
This is because bindStore, unbinds the store first.
Is there a way to capture the data at the nested func. and outside of the functions do the bindstore?

mitchellsimoens
4 Mar 2013, 9:53 AM
I never said to bind the store. If you want to show associated data this is most likely going to be within a cell as you don't want to get rid of the store already on the grid.