This works well when I declare it and call later MyView.render() (so render without args. However, we noticed that this dynamic context is not reapplied when render is call with args. Typically, if your decide to do this kind of code :
When the change event is triggered (for example by a fetch), the dynamic context will not be part of the render.
We detected that this problem occurs because of ensureContext function in resthub.js. In fact when render is called whith an arg, this .each loop ignore the dynamic context :
In this, our custom parameters is given in a dynamic context with a "viewOptions" attributes. So as the key viewOptions exists, we can have thus a dynamic context.
Hi,
Info : "// RESThub Backbone stack 2.1.2"
I needed to create a dynamic context to a view. So I followed your documentation ( http://resthub.org/backbone-stack.html#default-render-with-root-and-context-attributes ), paragraph about creating a dynamic context.
This works well when I declare it and call later MyView.render() (so render without args. However, we noticed that this dynamic context is not reapplied when render is call with args. Typically, if your decide to do this kind of code :
When the change event is triggered (for example by a fetch), the dynamic context will not be part of the render.
We detected that this problem occurs because of ensureContext function in resthub.js. In fact when render is called whith an arg, this .each loop ignore the dynamic context :
A solution we found, rewriting this _.each like this (we assume that this is maybe not the best manner, but it works) :
In this, our custom parameters is given in a dynamic context with a "viewOptions" attributes. So as the key viewOptions exists, we can have thus a dynamic context.
Thank you for considering this issue,
Stephen (AWL)