Binding with computed property property

4 posts, 0 answers
  1. Petr
    Petr avatar
    9 posts
    Member since:
    Feb 2013

    Posted 04 Nov 2013 Link to this post

    Hello,
    I created two examples. The first works, but needs one extra template. Is it possible to build without additional templates?

    working: http://jsfiddle.net/NLN6Z/1/
    notworking: http://jsfiddle.net/g9s33/1/

    Thank

    PS
    I was unable to create links without giving me erased already written text and cant login to account in chrome.
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 06 Nov 2013 Link to this post

    Hi Petr,

    Yes, but the activeData method should return observable array.
    activeData: function(){
        var result;
        $.each(this.get("data"), function(index, item){
            if (item.active == true) {
                result = item;
                return false;
            }
        });
         
        return result.rows;
    }


    Here is a link to the updated sample:

    Regards,
    Alexander Valchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Petr
    Petr avatar
    9 posts
    Member since:
    Feb 2013

    Posted 06 Nov 2013 Link to this post

    Thank you,
    yes it makes sense. But if the object will have a more property I need to write computed property for each of his property. Is there a simpler solution?
  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 07 Nov 2013 Link to this post

    Hi Petr,

    Kendo MVVM bindings are not JavaScript. I am afraid that there is no straightforward approach that does not require any workarounds (such as using second template) for your scenario.
    For more information please check the source binding help topic which lists all the supported scenarios by this feature:

    Regards,
    Alexander Valchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready