PDA

View Full Version : TreeNode.ensureVisible


quilleashm
07-24-2007, 08:50 AM
Hi all,

Ext: 1.1 RC1
Adaptor: ExtBase
Browser: FF 2.0.0.4
OS: Win XP

I believe there is a bug in TreeNode.ensureVisible. The docs state that this should make sure all parent nodes are expanded, which it does, but it also expands the node itself, which I think is incorrect.

Current code


ensureVisible : function(callback){
var tree = this.getOwnerTree();

tree.expandPath(this.getPath(), false, function(){
tree.getTreeEl().scrollChildIntoView(this.ui.ancho r);
Ext.callback(callback);
}.createDelegate(this));
},


Modified code, behaviour is as expected, changing so the path of the parent is passed to expandPath.


ensureVisible : function(callback){
var tree = this.getOwnerTree();

if (!this.parentNode)
return;

tree.expandPath(this.parentNode.getPath(), false, function(){
tree.getTreeEl().scrollChildIntoView(this.ui.ancho r);
Ext.callback(callback);
}.createDelegate(this));
},


Any more details required please let me know.

Cheers.

Mike.

jack.slocum
07-24-2007, 09:16 AM
That makes sense. Thanks for posting. We will have the change in te next release.