Server vs Client rendring of an empty model...

56 views
Skip to first unread message

Josh Callender

unread,
Mar 17, 2014, 6:39:36 PM3/17/14
to ren...@googlegroups.com
For background: I'm creating a new model for a page with a form. This form has event listeners attached to it and multiple subviews.

The bug: When I pass the model into the subview by doing the good ol' hack in preRender: function () { this.model = this.parentView.model(); } i get the error Uncaught TypeError: Cannot read property '_listenerId' of undefined.

It turns out.. that it's not creating a model in the bowels of Rendr on the client side, it just has the model_name and i can use the app.modelUtils.getModel(options.model_name) but that still doesn't have the listenerId defined on it for some reason.  Halp.

**Note** this works perfectly on the server side and I see all of the correct data, however the client side is just ignoring the fact I created a model on the server.
...

I've also attempted to fix some of these bugs by overriding the getTemplateData function in the base view to also send the entire model to the templates, however we run into the same issue on the client side of not having the model created.
Reply all
Reply to author
Forward
0 new messages