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(); }
暗夜之中,才见繁星;危机之下,暗藏转机;事在人为,为者常成。