PDA

View Full Version : HasMany Association Store load problem



börn
27 Jun 2012, 6:55 AM
Hi there,

don't know if this is discussed before... I have some trouble with an association store.

I have a model A with a hasMany association (myBs) to B. I also putted myBs() to a grid... this works very well... i also can add and remove records from that store.

Then i tried loading the associated store again (and i'm sure this worked on Ext4.0! - currently using 4.1.1RC2). And in the callback function i get successfully my wanted records... but (!) - after all the grid is empty and the loaded store has no items. That's because the filter property of that store shows a filter for a_id = "id of a". And after calling filter on that store it's completely erased... - very funny! I also tried to put my association id in the server data - but this property isn't part of the model's fields... so there is also no converter function generated and the property is skipped...

so how to do that? I really don't want to put the association id property on the reveived data by hand - i even don't know where to hook in for doing that?

el_chief
27 Jun 2012, 9:37 AM
http://extjs-tutorials.blogspot.ca/2012/05/extjs-hasmany-relationships-rules.html

börn
27 Jun 2012, 11:23 PM
oh crap... - i should have read the f*** manual.

So... because my server is doing the foreignKey combining of records for me, i configured a simple remoteFilter: true on the serverConfig on my hasMany-Association. This works very well ;)

thanks a lot