Template update only first time

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

    Posted 04 Nov 2013 Link to this post

    template for collection update only for first push.
    Click add button and only first time template rerender.

  2. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 06 Nov 2013 Link to this post

    Hello Petr,

    In order to fix this issue you should reference the data directly:
    activeData: function(){
        var result;
        $.each(this.data, function(index, item){
            if (item.active == true) {
                result = item;
                return false;
        return result;

    Here is a link to the updated jsFiddle:
    On a side note, using jQuery.each in this case might affect onto the performance. My recommendation is to either use a standard for loop or jQuery map method which is faster.

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top