-
12 May 2011 11:19 PM #1
Refresh node in tree panel
Refresh node in tree panel
Hi, in version 3 I used this to reload (from the server) a single node in a TreePanel:
treePanel.on('click', function(node, event) {
// some code to send update message to the server, causing the children to change
node.reload();
});
But I can't figure out how to do the same thing in extjs 4.
treePanel.on('itemclick', function(view, record){
// some code to send update message to the server, causing the children to change
// what goes here???
});
Thanks for your help
-
16 May 2011 12:55 AM #2
Heh, yeah, it's a bit of a faff now... NodeInterface is not very good IMHO.
Anyway, I do the following:
Obviously you need your tree store, and the view refreshing bit is needed for me since I change the icons during fillNode, and it doesn't seem to stick unless you kick itPHP Code:// Remove all current children if clear on load not set
if (!treeStore.clearOnLoad) {
record.removeAll();
}
// Call load, refreshing our view when done...
var viewRefresher = function() {
view.refresh();
};
treeStore.load({
node: record,
callback: viewRefresher
});

Not quite as simple as pre-Ext 4....
Hope that helps,
Westy
-
16 May 2011 11:10 PM #3
-
26 May 2011 5:30 AM #4
The above workaround does the job, however it is not very efficient.
Does anyone know how to reload a single node in a tree?
The 3.x way was by far less complex
-
26 May 2011 5:55 AM #5
Agreed, and it only reloads children, not that nodes data itself.
It's on my list to sort out properly, but no time at the moment.
Of course, if someone gets there first I'd be happy to re-use
Really do not like the new tree, it's painful, buggy and slow...
-
26 May 2011 6:50 AM #6
-
27 May 2011 3:17 AM #7
i join my voice to yours..
i still cant make a treepanel work not even the example!
-
27 May 2011 5:17 AM #8
I have to say I fought with it for a week as well just to get ours ported from 3.x to 4.
Finally I figured out you could pass a Node to the load method to get nodes loaded.
Some how I managed to miss that in documentation and all searching on line.
Now what I wish I could figure out quickly is how to on ItemClick, to not only load the nodes, but also expand it after the load happens. Anyone got that down?
-
11 Jun 2011 12:18 PM #9
I have same problem.
if i try update the TreeStoreCode:var node = myTree.getStore().getNodeById('myId'); // OK !!
and recover then node again,Code:myTree.getStore().load();
Code:var node = myTree.getStore().getNodeById('myId'); // UNDEFINED
-
28 Jun 2011 11:36 PM #10
I have tried you method to refresh my tree,but error occurred:"the mothod is not supported"
Similar Threads
-
Select the specific node, when refresh the tree
By cramade in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 5 Jan 2011, 1:51 PM -
Focus on the specific node, when refresh the tree.
By cramade in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 7 Jan 2010, 4:21 PM -
Tree Node Refresh 2.2
By millenovecento in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 28 Jan 2009, 8:44 AM -
Refresh Grid content on click event of tree node
By AmitOlsys in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 30 Jul 2008, 11:01 PM


Reply With Quote