| Page 1 of 1 | [ 3 posts ] |
|
when using gallery-model-relate I was under the impression that when data in one model changed the relationships were all updated.
Can anybody who uses / knows this module confirm and please look at the following code which doesn't appear to work as I would expect: http://jsfiddle.net/DwQsb/3/ Thanks Richard. |
|
This is tricky, but I think I see what's going on here. Yes, the modelLists returned by gallery-model-relate will automatically update as the model data is changed. In your fiddle, you aren't actually changing any model data. You are destroying a model.
gallery-model-relate internally uses gallery-model-store to hold on to a reference of all model instances. Even if you've destroyed a model, it is still in the model store, and its data is still in tact. This is why you aren't seeing your modelLists update automatically. I've slightly modified the fiddle to remove the model from the model store at the same time it gets destroyed. I think this yields the results your are looking for. http://jsfiddle.net/DwQsb/16/. |
|
thanks for this, i am not sure why this would not be automatically handled by the model-relate?
what do you think? |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group