문제

when i create sub node using fallowing function newly create node not view in the tree nodes. but reload page using press F5 key. show newly create node in the tree nodes how can i view node without reload webpage?

  createSubCategory: function() {
     dt    = new Date();
     id    = dt.format('U');
     name  = 'New Sub-Category'
     if(this.treepanelSkillCat.selModel.selNode == null) 
     {
        Ext.MessageBox.show({
           buttons: Ext.MessageBox.OK,
           icon:Ext.MessageBox.ERROR
        });
        return false;   
     }         
     var parent        = this.treepanelSkillCat.selModel.selNode.id;      

     var newNode       = new Ext.tree.AsyncTreeNode({id: id, text: name, leaf: false});
     form_data         = {'SKL_CAT_ID': id , 'SKL_CAT_NAME' : name, 'PARENT_SKL_CAT_ID' :parent }; 

     this.nodeAction   = 'addtotree';
     this.selNode      = newNode;   

     this.submitNode(form_data,'addtotree');
     this.treepanelSkillCat.selModel.selNode.appendChild(newNode);
  },

before reload after reload can view newly add sub child node in the last node as below

도움이 되었습니까?

해결책

Try reloading the treePanel store in the callback of your submitNode method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top