FAQ Database Discussion Community


Trying to use allowCode in JsRender with {{* window.counter++ }} and test the result using boolean test

javascript,jquery,jsviews
I have the following template <script type="text/x-widget-template" id="genericRowValues"> {{* window.counter = 0}} {{props}} {{* console.log(counter == 0)}} {{if counter == 0}} {{* console.log("WHY YOU NO WORK!")}} <div class="row"> {{/if}} <div class="col-lg-4"> <div class="input-group" style="margin-bottom:5px;"> <b>{{>key}}</b> <div class="well well-sm"> {{>prop}} </div> </div> </div> {{if counter == 4}} {{* counter = 0}}...

JsViews how to make data binding happen on root object as well as its nested properties?

javascript,jsviews
I am experiencing odd behavior when data linking an object to a form that led me to re-question what exactly is being data bound? Basically I have a form that creates new Companies as well as updates them. The actual creation/update is done via ajax, which is why I am...

In jsViews there is a `setProperty()` method. How do I do `removeProperty()`?

jsrender,jsviews
In the jsRender documentation there is a method $.observable(object).setProperty() but how do I remove a property from the object observably?

JsRender/JsViews: How to get {for} working for subclassed arrays

typescript,jsrender,jsviews
I've subclassed Array (using TypeScript), in order to be able to add extra functions to the Array. See code below. Since then, I've noticed that the {for} tag of JsRender/JsViews does not work any more. I've also noticed JsRender/JsViews uses $.isArray(...) in order to iterate arrays, which will return false...

Using jsViews/jsRender with a property retuned as dictionary entries

javascript,jquery,jsviews
I was wondering why cannot seem to get this down correctly. I have a JSONResult in MVC returning a collection of "Job" objects. One of the properties of the "Job" objects is a Dictionary. I cannot seem to figure out how to add this to the "Job" entity template, so...