View Full Version : Callback not called in Ext.tree.TreePanel.selectPath

11 Jun 2007, 12:01 PM
In some cases the callback is not called.

I changed the code of TreePanel.selectPath() (line 328) to the following and now the callback is called:

Ext.tree.TreePanel.prototype.selectPath = function(path, attr, callback){
attr = attr || "id";
var keys = path.split(this.pathSeparator);
var v = keys.pop();
if(keys.length > 0){
var f = function(success, node){
if(success && node){
var n = node.findChild(attr, v);
callback(true, n);
else callback(false, n); // please add this line to Ext !!
callback(false, n);
this.expandPath(keys.join(this.pathSeparator), attr, f);
callback(true, this.root);
This seem to be a bug for me :-)
(Took me one houre plus to find out, why my callback wasn't called)

I try to reload the tree if selectPath fails to get fresh nodes from the server (someone else could have changed the data).
I try:

this.tree.selectPath(path, undefined, function(success){
console.log("selectPath callback");
console.log("path " + path + " not found")
this.tree.selectPath(path, null, function(success){
console.log("after reload: still not found")
else console.log("selected: ", path)
May be there is an easyier way to do this ?

30 Jun 2007, 2:48 AM
I can't understand this.
I analysed and described this bug in detail in this post.
To add this line of code should take one minute.

The only reason I can think of why this bug has not been fixed ist that this post has never been read by the Ext developers.

So tell be why I should take me time to post a bug together with a correction surgestion when it will be completly ignored?

I event posted a reminder in this post

30 Jun 2007, 12:33 PM

Calm down. We didn't ignore your post and we do appreciate the detailed report. This release had quite a few bug fixes in it and somehow this one slipped through. I have added the change now and it will be in the next release.