right that's why i linked the upgrade guide, you'd have to migrate code
probably wouldn't be easy
arathi-sreekumar
@arathi-sreekumar
hmmm
I will have to see if I can migrate, since this is one among the many projects I am sharing time on as well
and tend to get pulled out
:(
Tim Branyen
@tbranyen
that sucks
arathi-sreekumar
@arathi-sreekumar
I did want to upgrade, but might not have enough time
I'll give it another go
but I have to upgrade backbone.js as well
from 1.0.0 to 1.2.1
arathi-sreekumar
@arathi-sreekumar
is 1.2.1 the backbone version it depends on?
arathi-sreekumar
@arathi-sreekumar
Ok, will have to park it, I tried, seems like backbone is way out of date
so I would have to update backbone and literally rewrite a lot of the code across multiple files :(
I might just revert to one id and keep that as solution for now
thanks for the time and effort in trying to help me out
:)
Simen Bekkhus
@SimenB
Has anyone had any luck passing the promise from render().promise() to bluebird (Promise.resolve(view.render().promise()))? It crashes the site for me...
Simen Bekkhus
@SimenB
created #483 for it
Tim Branyen
@tbranyen
@SimenB hrm, i hate to say this, but i feel like what you did may be overkill. what if we just did:
@tbranyen If that works, even better! I'll test it out :smile:
Simen Bekkhus
@SimenB
Doesn't work... I'll take the discussion in the issue
Tim Branyen
@tbranyen
How is that possible though?
that's valid promise syntax
_
Oh, wait it's not then related is it? It's the promise function that's the culprit
urgh, this is a tough one
foligny
@foligny
Hi !
I'm trying to find out when all the child views have rendered.
In the main view I loop over collection as row and call multiple time self.insertView(row)
Unfortunately it seems that afterRender() of the main view happens before the child views are rendered. What is the best way to know that all view I have inserted have rendered ? Thanks!!
Tim Branyen
@tbranyen
Hrm, if you do parent.renderViews() afterRender will happen after the children are done
foligny
@foligny
Where should I do parent.renderViews() ? Wont this render twice my views ?
Tim Branyen
@tbranyen
@foligny hrm, I guess I'm not sure what your issue is. the regular render method will not emit afterRender until all child views have rendered
foligny
@foligny
@tbranyen I double checked that child's view afterRender are fired after parent view. Maybe it is because the child views are added in beforeRender() of the parent's view ?
foligny
@foligny
Is there a way I can get the render promise of a view ?
Tim Branyen
@tbranyen
@foligny .promise()
Tim Branyen
@tbranyen
@foligny were you able to resolve your issue
i'd like to help more if not
since the point of the render flow is that parents are not fully resolved until child views are
foligny
@foligny
Hi! No I wasn't able because view.promise() is undefined. Also the product's UI I'm working on uses an older version of backbone.layoutmanager. Also renderViews() is not called; instead _render() is called originating from root._registerWithRAF(actuallyRender, def); in the call stack. I guess my next step would be to try the latest version of layoutmanager. But in the meantime I found a workaround to resolve my original problem.
Tim Branyen
@tbranyen
Oh darn, that really stinks. There were some major issues in some versions of LM
Sorry you happen to be one that most likely experiences that particular bug
foligny
@foligny
Thanks Tim, no worries.
Simen Bekkhus
@SimenB
Is there any particular reason why I can't define views as a function? This would match Backbone's functionality where most (all?) attributes can either be defined statically or as a function
I realise I can achieve what I want in beforeRender using setViews, but I like how declarative views are
Tim Branyen
@tbranyen
That feature could definitely be added @SimenB
Joshy Cyriac
@joshy
Hi Tim, it seems the domain layoutmanager.org has been expired
Tim Branyen
@tbranyen
Darn, I saw notices about it. Thanks for the heads up!
Tim Branyen
@tbranyen
@SimenB looks like we had some weirdness with QUnit and calling the async start() method inside of then. basically need to do then(function() { start(); }) instead of then(start)