| Page 1 of 1 | [ 4 posts ] |
|
I have a view, and on initialisation it makes say 3 remote calls for data models, I currently have an after "load" event for each of the models which requests a 're-render'.
a couple of questions, as the data comes in and starts the render lifecycle, what happens when the view is currently in a render lifecycle and another data load event requests a 're-render' - does it wait until its finished the current render and then re-render again? If so what is the best way to program such a model? because if the DOM render were expensive I would have thought waiting for all data sources to be complete loading then rendering the DOM would be the preferred scenario? What would be the neat way to code this? Thanks Richard. |
|
Hey Richard,
I'd say it depends on what you do with the payloads from the 3 remote calls. If you need to display the info from all 3 payloads simultaneously then you should just wait until all 3 payloads are received, then make a single render() call. If each of the payloads can be used independently to draw an independent piece of the view, then at that point, perhaps create sub-views and models for each of the remote calls you refer to. |
|
Y.Parallel can help with this sort of thing: http://yuilibrary.com/yui/docs/yui/parallel.html
|
|
Wow, that can be pretty useful. Thanks for sharing, Eric.
|
| Page 1 of 1 | [ 4 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