This is a migrated thread and some comments may be shown as answers.

Binding with computed property property

3 Answers 104 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Petr
Top achievements
Rank 1
Petr asked on 04 Nov 2013, 06:53 PM
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.

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 06 Nov 2013, 11:50 AM
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!
0
Petr
Top achievements
Rank 1
answered on 06 Nov 2013, 12:33 PM
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?
0
Alexander Valchev
Telerik team
answered on 07 Nov 2013, 05:02 PM
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!
Tags
Templates
Asked by
Petr
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Petr
Top achievements
Rank 1
Share this question
or