0
votes

I am working with JsViews/JsRender and quite complex dataSet. Currently I have some issues with updating the rendered values after data model changed.

Could anyone please tell me, why the in the following code: http://jsfiddle.net/kWBFS/22/ refreshing binded values with $.observable(...).refresh(...) and $.observable(...).setProperty(..., ...) does not work?

Might be here something wrong with attached libraries? No error occurs in console.

Thanks a lot!

1

1 Answers

0
votes

You can't do data-binding with just a render() call. JsRender does string-based template rendering, but does not do data binding in the DOM.

There are a lot of examples, such as here http://www.jsviews.com/#jsvplaying and here http://www.jsviews.com/#samples, which you should take a look at...

Updated fiddle: http://jsfiddle.net/MNcyg/1/

//$("#div1").html(
//    $("#template").render(structure)
//);
$.templates("#template").link("#div1", structure);

You need to call the link() method, not the render() method.