extjs4 树列表 添加子节点 刷新所有父节点数据

itemclick:function(view, record, item,index){console.log(record.parentNode)
                    for(pNode = record.parentNode;pNode.data.id!="root";pNode=pNode.parentNode){
                        console.log(pNode.data.id)
                        pNode.data.duration = Math.floor(Math.random()*10+1)
                    }
                    view.refresh()
                    var newRecord = {'task':'abc', 'user':'abc','duration':'abc','grade':'abc'}
                    record.appendChild(newRecord)
                    record.data.leaf = false;
                    record.expand()
                    console.log(record.hasChildNodes()) 
                    //record.triggerUIUpdate();
                }

 

posted @ 2013-12-20 17:11  zenghansen  阅读(515)  评论(0编辑  收藏  举报