How to reload selected tree node

I need to reload the tree after deleting one of the node sheets. The problem of reloading the entire store is too slow. So I just want to reload node where its sheet is deleted.

I tried this, but it says null ...

Ext.getCmp('myTree').root.reload(); 

I also tried

 var tempParent = Ext.getCmp('myTree').getSelectionModel().getSelection()[0].parentNode; Ext.StoreMgr.lookup('myStore').load( {node: tempParent}); 

this does not help ... Does anyone have similar problems that have been resolved?

Update

 var node = Ext.getCmp('myTree').getSelectionModel().getSelection()[0].parentNode.get('id'); 

this gives me the parent node ... but when i load it

 Ext.getCmp('myTree').store.load({ node: node }); 

I get this error

TypeError: b.getId is not a function

Second update -

This is what my tree looks like

  • 1st Node

    • 1st sheet
  • 2nd Node

    • 1st sheet

Now when I delete the 1st sheet of the 2nd node ... the 1st node appears under the second Node

  • 1st Node

    • 1st sheet
  • 2nd Node

    • 1st Node
+7
source share
1 answer

Here's how to update a specific tree node. In your case, you might want to update the parent node in which the changes should be shown:

  refreshRow:function(id){ var node = this.store.getNodeById(id); if (node){ this.store.load({node:node}); } } 

Update

Based on the information you provided, I came to the conclusion that you are trying to populate the same node with a specific server identifier in several places in the tree. Tree store does not support this. Each node must have a unique identifier, even if the rest of the node information is the same.

+4
source

All Articles