-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controller doesn't wait the Model to finish loading the data before rendering. #44
Comments
Have you checked this? ###
Renders to some view
@param [String] path Path to view on the app tree
@param [String] data data to be rendered on the template
###
render:( path, data )->
@the.factory.view path, (view)=>
@process.view = view
view.process = @process
view.after_in = @after_render
if data instanceof Fetcher
if data.loaded
view._render data.records
else
data.onload = ( records ) =>
view._render records
else
view._render data |
I agree before the data is loaded, another method should be called ( perhaps, before_receive_data ? ) so the view can have an action before the template's data is received. Some times you want your view to be rendered before the data is loaded in order to add a loader to the DOM. Actually now i remember @arboleya saying something about solving this "gap" somewhere else in the framework. Still i do think we might benefit from calling "before_receive_data" ( or something like that ) in the view before calling render. This is actually a sensible subject, since some applications have loaders following the mouse, therefore not destroying the current view until the data is loaded. Other's actually needs to destroy the view instantly and render the loader into the "#container" div which will actually render the new view after loading the data. |
This awkward behavior introduced by the At that time, the Currently it seems that this can be totally improved since the |
my bad, i didnt know it didnt need to return a view on v2. Anyway i still think having either a loader assciated with a cotainer or a view being created and notified about the fact the data is being loaded ( therefore the render chain will br called soon ) can be very useful! peace |
The whole loading process, not only of model data but also assets etc, must to be demystified and designed to work in a transparent way. |
The default controller action implementation doesn't wait the
model
to load the data before rendering theview
Eg:
I am still thinking about a better implementation for this, do you have any thoughts?
The text was updated successfully, but these errors were encountered: