Skip to content


Subversion checkout URL

You can clone with
Download ZIP


changes in nested arrays don't trigger the dependent functions of a parent property #8

dnjreinders-85 opened this Issue · 1 comment

2 participants


First of all I wan't to compliment you on your work on JSViews. I think data-driven views are the future off building web-application and that it will provide lot's of help with implementing your information-models within a information-system.

when you have got data like an order (see below), a properties like Total_Price and Total_lines depends on the data in the Orderlines array.

When rendering jsviews triggers a function that calculates the total price and the total amount of lines (this goes well).
However when changing a value within the orderlines, or add a line to the array with the array observable, jsviews doesn't trigger the functions depending on the property orderlines within the parent, so the amount of lines and the total price won't get updated.

If you need a full example please ask.

P.S. Is it possible to create nested context's or context's that are linked to just ONE property? And what are the possibilities of linking a model to your data to be sure a field contains validated values (creating toLinks should work fine, but can these links also be nested...)?

Thanks in advance,

/*--- tmpl: #orderlineTemplate --*/

/*-- tmpl: #orderTemplate --*/

var OrderData = {
    Orderlines : [
            Product : "Product X",
            Amount : 1,
            Price_each : 1,
            Price : 1
            Product : "Product X",
            Amount : 2,
            Price_each : 2,
            Price : 4
    Total_price : 0,
    Total_lines : 0


$( "#addOrderlineBtn" ).click( function() {
    $.observable( OrderData.Orderlines ).insert( OrderData.Orderlines.length, {
        Product : "Product", 
        Amount : 1,
        Price_each : 1,
        Price : 1

Closing this, since there is now support for computed observables. See for example

@BorisMoore BorisMoore closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.