1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    15
    Vote Rating
    0
    next is on a distinguished road

      0  

    Default TemplateView.js, bug in refreshNodes()

    TemplateView.js, bug in refreshNodes()


    Hi Jack,

    thanks four your unbelievable work on yui ext!

    I think I ran into a bug in TemplateView.js:

    Code:
    YAHOO.ext.View.refreshNodes : function(dm, startIndex, endIndex){
            this.clearSelections();
            var dm = this.dataModel;
            var ns = this.nodes;
            for(var i = startIndex; i <= endIndex; i++){
                var d = this.prepareData(dm.getRow(i), i);
                if(i < ns.length-1) {
                    var old = ns[i];
                    this.tpl.insertBefore(old, d);
                    this.el.dom.removeChild(old);
                }else{
                    this.tpl.append(this.el.dom, d);
                }
            }
            this.updateIndexes(startIndex, endIndex);
    }
    The problem is the condition if(i < ns-length - 1):
    Instead of the last node being updated in case of a change, a new node is inserted at the end of the view.
    The condition should be fixed to (i < ns.length).

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    Thanks, I put in the correction.

Thread Participants: 1